<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Great coffee with a conscience on My blog</title><link>https://blog.nys.tf/</link><description>Recent content in Great coffee with a conscience on My blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Thu, 18 Jul 2019 10:04:10 +0000</lastBuildDate><atom:link href="https://blog.nys.tf/index.xml" rel="self" type="application/rss+xml"/><item><title>Paste structured messages in multiple inputfields</title><link>https://blog.nys.tf/post/argenta-paste-structural-message/</link><pubDate>Thu, 18 Jul 2019 10:04:10 +0000</pubDate><guid>https://blog.nys.tf/post/argenta-paste-structural-message/</guid><description>
&lt;h1 id=&#34;the-problem&#34;&gt;The problem&lt;/h1&gt;
&lt;p&gt;I was not able to paste structured messages into the form of my bank because it used multiple inputfields which would not detect what I was pasting. I made a little bookmarklet that I need to activate before pasting and magically it works!&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://jsfiddle.net/xehjvkub/3/&#34;&gt;jsFiddle of the solution&lt;/a&gt;&lt;/p&gt;
&lt;h1 id=&#34;the-bookmarklet&#34;&gt;The bookmarklet&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&#34;language-javascript&#34;&gt;javascript:(function(){
if (!window.jQuery) {
console.error(&#39;No jquery found!&#39;);
return;
}
if (window.hasPasteBookmarkletLoaded) {
console.log(&#39;allready loaded&#39;);
return;
}
$(document).ready(function(){
window.hasPasteBookmarkletLoaded = true;
$(&#39;body&#39;).on(&#39;paste&#39;,&#39;.ag-structured-be-input input[name=&amp;quot;communication-be-1&amp;quot;]&#39;, function(e) {
const element1 = $(&#39;.ag-structured-be-input input[name=&amp;quot;communication-be-1&amp;quot;]&#39;);
const element2 = $(&#39;.ag-structured-be-input input[name=&amp;quot;communication-be-2&amp;quot;]&#39;);
const element3 = $(&#39;.ag-structured-be-input input[name=&amp;quot;communication-be-3&amp;quot;]&#39;);
const pasteData = e.originalEvent.clipboardData.getData(&#39;text&#39;).trim();
console.log(&#39;Pasted &amp;quot;&#39;+pasteData+&#39;&amp;quot;&#39;);
const regex = /^(\+\+\+)?(\d{3})\/?(\d{4})\/?(\d{5})(\+\+\+)?$/;
const nonIntRegex = /[^\d]/g;
const stripped = pasteData.replace(nonIntRegex,&#39;&#39;);
if (regex.test(pasteData)) {
console.log(&#39;Regex passed!&#39;);
console.log(&#39;Stripped: &#39;,stripped);
console.log(&#39;Stripped: &#39;,stripped.slice(0,3));
console.log(&#39;Stripped: &#39;,stripped.slice(3,7));
console.log(&#39;Stripped: &#39;,stripped.slice(7,12));
element1.val(stripped.slice(0,3)).trigger(&#39;change&#39;);
element2.val(stripped.slice(3,7)).trigger(&#39;change&#39;);
element3.val(stripped.slice(7,12)).trigger(&#39;change&#39;);
} else {
console.log(&#39;No regex match&#39;);
}
});
});
})();
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Usefull regexes</title><link>https://blog.nys.tf/post/usefull-regexes/</link><pubDate>Thu, 18 Jul 2019 10:04:10 +0000</pubDate><guid>https://blog.nys.tf/post/usefull-regexes/</guid><description>
&lt;h2 id=&#34;transform-twig-translation-tags-to-translation-filters&#34;&gt;Transform twig translation tags to translation filters&lt;/h2&gt;
&lt;p&gt;Find: &lt;code&gt;(?&amp;lt;!=)[&amp;quot;&#39;]\{% trans %\}(.*?)\{% endtrans %\}([! ]?)[&amp;quot;&#39;]&lt;/code&gt;&lt;br /&gt;
Replace: &lt;code&gt;&amp;quot;{{ &#39;$1&#39;|trans|escape(&#39;js&#39;) }}$2&amp;quot;&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Changing Keyboard-layout</title><link>https://blog.nys.tf/post/changing-keyboard-layout/</link><pubDate>Tue, 18 Dec 2018 16:15:57 +0000</pubDate><guid>https://blog.nys.tf/post/changing-keyboard-layout/</guid><description>
&lt;h1 id=&#34;source&#34;&gt;Source&lt;/h1&gt;
&lt;p&gt;This is all based on &lt;a href=&#34;|How to modify a keyboard layout in Linux&#34;&gt;http://rlog.rgtti.com/2014/05/01/how-to-modify-a-keyboard-layout-in-linux&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I made a change to &lt;code&gt;/usr/share/X11/xkb/symbols/be&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The following was added:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Coder layout
partial alphanumeric_keys
xkb_symbols &amp;quot;coder&amp;quot; {
include &amp;quot;be(basic)&amp;quot;
name[Group1]=&amp;quot;Belgian (Coder)&amp;quot;;
key &amp;lt;BKSL&amp;gt; { [ grave, mu, sterling, dead_breve ] };
key &amp;lt;AE09&amp;gt; { [ braceleft, 9, ccedilla, plusminus ] };
key &amp;lt;AE10&amp;gt; { [ braceright, 0, agrave, degree ] };
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then changes were made to 4 files in &lt;code&gt;/usr/share/X11/xkb/rules&lt;/code&gt;. The files are &lt;code&gt;evdev.lst&lt;/code&gt;, &lt;code&gt;evdev.xml&lt;/code&gt;, &lt;code&gt;base.lst&lt;/code&gt;, &lt;code&gt;base.xml&lt;/code&gt;.&lt;/p&gt;
&lt;h1 id=&#34;lst-files&#34;&gt;&lt;code&gt;.lst&lt;/code&gt;-files&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt; coder be: Belgian (Coder)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&#34;xml-files&#34;&gt;&lt;code&gt;.xml&lt;/code&gt;-files&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt; &amp;lt;variant&amp;gt;
&amp;lt;configItem&amp;gt;
&amp;lt;name&amp;gt;coder&amp;lt;/name&amp;gt;
&amp;lt;description&amp;gt;Belgian (Coder)&amp;lt;/description&amp;gt;
&amp;lt;/configItem&amp;gt;
&amp;lt;/variant&amp;gt;
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Contact</title><link>https://blog.nys.tf/contact/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://blog.nys.tf/contact/</guid><description>&lt;p&gt;We’d love to get in touch with you and hear your ideas and
questions. We strive to grow and improve constantly and your feedback
is valuable for us.&lt;/p&gt;
&lt;h3 class=&#34;f4 b lh-title mb2&#34;&gt;How can I get…?&lt;/h3&gt;
&lt;p&gt;You can also use the form below for any inquiries about coffee
availability, monthly subscriptions and scheduling a 1-on-1 session
with our baristas. Don’t be shy, drop us a line!&lt;/p&gt;</description></item></channel></rss>