<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[nightdrops]]></title><description><![CDATA[like the color blue]]></description><link>http://nightdrops.com/</link><generator>Ghost 0.5</generator><lastBuildDate>Thu, 07 May 2015 07:16:05 GMT</lastBuildDate><atom:link href="http://nightdrops.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Managing laravel auth and auth-token]]></title><description><![CDATA[<p>When you develop an app in Laravel, sometimes you need to have a webapp and her native counterpart. To manage the authentication on the API side, there's this lovely package that is <a href="https://github.com/tappleby/laravel-auth-token">tappleby\laravel-auth-token</a>. <br>
One of the les documented features of this package is how to maintain in sync the tokens and the laravel auth.</p>

<p>Why? Because when an api is called with the right token, you want to use Auth::user() and Auth::check(), for example.</p>

<p>What you need to do is add (at the end) of <code>app/start/global.php</code> this three events that will bound the token events to the authentication system  </p>

<pre><code class="php">Event::listen('auth.token.valid', function($user)  
{
    //Token is valid, set the user on auth system.
    Auth::setUser($user);
});

Event::listen('auth.token.created', function($user, $token)  
{
    //Token is valid, set the user on auth system.
    Auth::setUser($user);
});

Event::listen('auth.token.deleted', function()  
{
    //Token is removed, deauthenticate the user.
    Auth::logout();
});
</code></pre>]]></description><link>http://nightdrops.com/managing-laravel-auth-and-auth-token/</link><guid isPermaLink="false">b5a75e32-0dd6-4379-b387-c911ac67f604</guid><dc:creator><![CDATA[Carlo 'kj']]></dc:creator><pubDate>Tue, 28 Oct 2014 23:05:54 GMT</pubDate></item><item><title><![CDATA[So you need your pc fixed]]></title><description><![CDATA[<p>One in a while ( I said <em>week</em> ?) a friend of mine phones, mostly the one i did not hear for a long time, just to chat and ask me advice on their fallen hard disk, bricked smartphone or whatelse.</p>

<p>I am glad to thank Giorgio, that has pinned the problem and made a website around it: <a href="http://shouldiaskmytechfriendtofixmypc.com/">shouldiaskmytechfriendtofixmypc</a></p>

<p>(Yes, there's a reference to <a href="http://dowebsitesneedtolookexactlythesameineverybrowser.com/">dwsntletsieb</a>.</p>

<p>Thanks Giorgio</p>]]></description><link>http://nightdrops.com/so-you-need-your-pc-fixed/</link><guid isPermaLink="false">2bd3640c-3075-4daf-9490-3ef489beb442</guid><dc:creator><![CDATA[Carlo 'kj']]></dc:creator><pubDate>Sat, 20 Sep 2014 12:31:00 GMT</pubDate></item><item><title><![CDATA[Let ghost be]]></title><description><![CDATA[<p>After 2 days full of talks at <a href="http://2014.fromthefront.it/">From the Front</a>, I'm happily back to work (on saturday, duh).</p>

<p>There were lots of interesting talks and some ideas that needs to be metabolized - not an easy 'show your code' conference for sure! :-)</p>

<p>On a lighter side, what I couldn't resist to do after a couple of beers with friends, was updating my blog from wordpress to ghost.</p>

<p>Why?</p>

<p>Because it's minimal, because I love editing posts in <a href="http://daringfireball.net/projects/markdown/">Markdown</a> and I find that WYSIWYG editors produce shitty HTML, and because it's on nodejs.</p>

<p>Thanks to <a href="http://blog.henshaw.me/ghost-blogging-essentials/">Jon Hanshaw</a> for the tips on the essentials customizations.</p>

<p>Now to sleep!</p>]]></description><link>http://nightdrops.com/let-ghost-be/</link><guid isPermaLink="false">14013399-802d-450e-b67d-8ebed6f09ba0</guid><dc:creator><![CDATA[Carlo 'kj']]></dc:creator><pubDate>Fri, 19 Sep 2014 22:44:04 GMT</pubDate></item><item><title><![CDATA[About interviews]]></title><description><![CDATA[<p>I know it's a widely explored topic, but after a row of bad interviews I would like to spell out what I think it's the baseline to a decent job interview.  </p>

<h2 id="alittlepremise">A little premise</h2>

<p>I work in the interface development department of a big company, and I interview web designers, interface developers, frontend developers and sometimes assist my co-workers in other web related interviews  </p>

<h2 id="thefirstthingcharacter">The first thing: character</h2>

<p>The first and most important questions (IMHO) I ask are open questions about what the candidate thinks about some technology (or anything, really). Sometimes I ask about something that is universally known ad bad, ugly, or old. You can't know how many persons reply "I like that" thinking that if I asked then it interests me. <em>No no no no</em>. The worst mistake.</p>

<p>If you don't like something, say it. Even if the interviewer might disagree (but if he has skill, hardly will defend an old / ugly / old matter). First you must have character and skill and if something is wrong you must stand for your opinion.</p>

<p><em>I don't want to work with someone that doesn't have an opinion.</em><!--more--></p>

<h2 id="thebasicsskills">The basics: skills</h2>

<p>I'd like to assume that if you apply for an Interface Developer position, you know your tools and the related programming languages. So the will be basic questions just to make sure that we speak the same language. Something incredibly stupid thing I (often) see is people that repeat what I say.  </p>

<blockquote>
  <p>"Do you know javascript?"
  "Ah yes, javascript!"
  "Which framework do you prefer?"
  "Every framework!"</p>
</blockquote>

<p>Please don't. If you don't know what we are talking about, have the guts to say it. At least there may be a chance to learn something.</p>

<p>The interviewer might not be interested in the most skilled guy on earth, but good curiosity and passion for the subject will compensate (And you can't fake those in the long time).</p>

<p>Stated that you have your skills, what matters if that you can relate to everything that happens around you, so you can do a better job. You want to work for the website X, then: How many users daily might the website have? How many production servers do you think they have? Less or more, of course, but being aware of the context will help, and it shows me that you are curious. Which at the end of the day, <em>it's the only thing that matters</em>.  </p>

<h2 id="theportfolioandthecv">The portfolio and the cv</h2>

<p>You don't really have to have a old school portfolio but a couple of advices:</p>

<p>Triple check your CV: if you are being interviewed to work on the presentation layer, and the fonts are not - at least - consistent, ask yourself what are you doing.</p>

<p>Your CV is in word? You CV is on a standard format (like the european format)? You loose points. I'm not expecting to see an infographic every time - and I'm glad of it - but a bit of creativity helps.</p>

<p>Have ready some examples of previous works. You worked only on NDA and closed projects? Then have a personal website telling about how you like cats (or whatelse). You don't even have a personal website? What are you doing here?  </p>

<h2 id="mywebsite">My website</h2>

<p>Well, actually the company website: since I work for a relatively big e-commerce, chances are that you have seen one of the company's websites. Please have the decency to come having seen the company website, and if interviewed as a webdesigner / interface developer have also the courtesy of spotting something you like and something you don't in the design or in the code. No you don't need to find a bug, but questions like<em> "Why you use jquery instead of &lt;name another framework&gt;?"</em> are welcome.</p>

<p>I know that all of these things seems trivial, but every time there is someone that slips on the basics and the interview becomes awkward. Please give yourself the gift of a chance.</p>]]></description><link>http://nightdrops.com/about-interviews/</link><guid isPermaLink="false">6b238b27-502e-47fe-8fb1-58b2303cbbc3</guid><dc:creator><![CDATA[Carlo 'kj']]></dc:creator><pubDate>Thu, 28 Feb 2013 11:00:00 GMT</pubDate></item><item><title><![CDATA[Compass: from zero to production in 20 minutes]]></title><description><![CDATA[<p>Recently we decided it was time to write better css and optimize a little, and we did choose <a title="compass-style" href="http://compass-style.org/" target="_blank">compass</a> and the scss syntax as the tool.</p>

<p>The project i'm workin on is organized with a very big css/ folder with a css for every page, a couple css for the common classes and some css files with fixes for certains nations (I'm speaking of Russia, China and Japan, where we have different fonts and all the spacing changes); it is also deployed with continuous integration on several test environments and the production cluster.</p>

<p>In the past we did try a conversion to less, but it was unsuccessful, mainly because the less syntax is not compatible with css so we needed to restyle every page (a lot).</p>

<p>We planned a lot on how to introduce the scss files and after several tries we noted that:  </p>

<ul>  
    <li><span style="line-height: 14px;">it was unnecessary to rewrite a single line of css: the scss syntax is superset of css</span></li>
    <li>we did not need to convert scss file live and cache them - at the beginning we could source control both</li>
</ul>  

<p>Once all the interface developers were the loop and motivated (pretty easy ;-), we decided to migrate in steps, to make the transition easy:  </p>

<ol>  
    <li><strong>Copy the css folder to a new 'sass' folder and rename (batch rename) all the files to .scss</strong>, commit and celebrate. This is the core action to introduce sass.</li>
    <li><strong>Modify the continuous integration script to recompile all the css during the build/deploy task</strong>: this way we could remove the css file from versioning and avoid unnecessary merges</li>
    <li><strong>Modify the above script to deploy the generated sprites: </strong>we keep them on different servers and we decided it was not a vital step, so we separated from the second.<!--more--></li>
</ol>  

<p>The big point is that between step 1 and 2 we let several days pass by. This way all the developers could taste the scss sweetness and bring their sub-projects up to speed. We don't like big changes   :-). Beside that, the first step is really the core of setting up scss, and it only takes a few minutes.</p>

<p>What we gained? Now the situation is pretty much the same ( the code is messy) but we can work a little every day, along the normal maintenance, to sort things out, and there is no need for a 'stop everyone and make clean' task: the business would never have allowed us that.</p>

<p>On the performance side, the minified css globally weight <strong>a third</strong> of the originals. Yo!</p>

<p>&nbsp;</p>]]></description><link>http://nightdrops.com/compass_in_20_minutes/</link><guid isPermaLink="false">11451f21-fdbe-4529-ad70-52811742eccd</guid><category><![CDATA[compass]]></category><category><![CDATA[project maintenance]]></category><category><![CDATA[sass]]></category><category><![CDATA[scss]]></category><dc:creator><![CDATA[Carlo 'kj']]></dc:creator><pubDate>Sat, 02 Feb 2013 00:20:25 GMT</pubDate></item><item><title><![CDATA[ffmpeg not found after brew installing]]></title><description><![CDATA[<p>After installing ffmpeg on my Mac OS X with brew (with the command)  </p>

<pre class="brush: bash; gutter: false">brew install ffmpeg --use-clang</pre>  

<p>I could not reach ffmpeg from the command line. For some reason the installer forgot to link the bin file. Simply solved with  </p>

<pre class="brush: bash; gutter: false">ln /usr/local/Cellar/ffmpeg/1.0/bin/ffmpeg /usr/local/bin/</pre>

<p>Posted just in case this happens to someone else.</p>]]></description><link>http://nightdrops.com/ffmpeg-not-found-after-brew-installing/</link><guid isPermaLink="false">dbeaaa7e-d583-4515-996b-4d2f908137eb</guid><category><![CDATA[brew]]></category><category><![CDATA[ffmpeg]]></category><category><![CDATA[mac os x]]></category><dc:creator><![CDATA[Carlo 'kj']]></dc:creator><pubDate>Sun, 06 Jan 2013 02:18:25 GMT</pubDate></item><item><title><![CDATA[rainy mood]]></title><description><![CDATA[<p>This site it's incredible.</p>

<p><img src="http://24.media.tumblr.com/tumblr_m11ig0jiNI1ro6i12o1_500.png" alt="I love rainy days">
image courtesy of <a href="http://i-like-words-a-lot.tumblr.com/post/19460687666">Logophile</a> <br>
Basically it has rain-in-the-forest recording that loops. You have to listen to it with (a good pair of) headphones, and it will make you think that you are in a forest, during a storm (except you don't get wet).</p>

<p>I've discovered it a years ago, more or less, and I am always keeping it open when I work. It is a great way to isolate you acoustically and concentrate, without the distraction that random music with lyrics brings.</p>

<p>And, as a bonus, when the summer it's really hot (and in Bologna can be really hot), tricks your brain and makes the day bearable.</p>

<p>Go to: <a href="http://www.rainymood.com/">rainymood.com</a></p>]]></description><link>http://nightdrops.com/rainy-mood/</link><guid isPermaLink="false">099f2c4e-4841-4a98-bd9d-5f5d3aa7258e</guid><category><![CDATA[mood]]></category><category><![CDATA[music]]></category><category><![CDATA[work]]></category><dc:creator><![CDATA[Carlo 'kj']]></dc:creator><pubDate>Fri, 04 Jan 2013 01:57:07 GMT</pubDate></item><item><title><![CDATA[Tutorial: Hide or show input passwords]]></title><description><![CDATA[<p>When typing a password, on desktop devices,the dots that are covering typed characters are useful, because we can assume that somebody might walk behind our desk and look at the password we are typing.</p>

<p>Password: <input type="password" value="password"></p>

<p>On mobile devices, it's harder to look - we hold the device in hand - and it's easier to make a mistake.</p>

<p>When the password is a key step in your business (to buy something, for example), you don't want users to go away because they are tired of rewriting a miswritten password.</p>

<p>It would be nice to have a toggle button that can show the password, to avoid typos and in the same time guarantee privacy when needed.</p>

<p>The html is simple: a form and an anchor to toggle the status:</p>

<pre><code class="html">&lt;input type="password" class="toggablePwd" /&gt;  
&lt;button&gt;show&lt;/button&gt;  
</code></pre>

<p>And the javascript: we need to notice that for security reasons you can't change the type attribute of a password input field. So the idea is to copy the html of the tag (thus preserving classes and other attributes) and repopulate the value field.</p>

<pre><code class="javascript">$("button").on("click", function() {
  var elemtn = $(".toggablePwd")[0].outerHTML;

  if ($(this).html() === "show") {
    elemtn = elemtn .replace(/password/, "text");
    $(this).html("hide");
  } else {
    elemtn = elemtn.replace(/text/, "password");
    $(this).html("show");
  }

  var val = $(".toggablePwd&amp;").val();
  $(".toggablePwd").replaceWith(elemtn);
  $(".toggablePwd").val(val);
});
</code></pre>

<p>You can see a demo <a href="http://jsfiddle.net/kajyr/DXRu2/15/embedded/result">here</a></p>]]></description><link>http://nightdrops.com/tutorial-hide-or-show-input-passwords/</link><guid isPermaLink="false">a751192c-c85a-42db-9112-b60391130f0b</guid><category><![CDATA[css]]></category><category><![CDATA[html]]></category><category><![CDATA[javascript]]></category><category><![CDATA[tutorial]]></category><category><![CDATA[usability]]></category><dc:creator><![CDATA[Carlo 'kj']]></dc:creator><pubDate>Tue, 11 Dec 2012 20:43:24 GMT</pubDate></item><item><title><![CDATA[Serendipity: phantomjs]]></title><description><![CDATA[<p>So while browsing pointless the intertubes, <a href="http://randomshopper.tumblr.com/post/35454415921/randomized-consumerism" target="_blank">this post</a> came to my attention, and I started reading about <a href="https://github.com/ariya/phantomjs" target="_blank">phantomjs</a>. I had already seen this project but never tried it. Now I'm officially curious.</p>

<p>This is the code to make a screenshot of a full web page:</p>

<p><code> <br>
var page = require('webpage').create(); <br>
page.open('http://google.com', function () { <br>
page.render('google.png'); <br>
phantom.exit(); <br>
});</code></p>

<p>&nbsp;</p>

<p>I'm totally hooked.</p>]]></description><link>http://nightdrops.com/serendipity-phantomjs/</link><guid isPermaLink="false">f571c2bb-30b4-46d3-906d-2c03d6a3a024</guid><category><![CDATA[javascript]]></category><category><![CDATA[phantomjs]]></category><dc:creator><![CDATA[Carlo 'kj']]></dc:creator><pubDate>Wed, 21 Nov 2012 23:37:51 GMT</pubDate></item></channel></rss>