Skip to content

Instantly share code, notes, and snippets.

View rhumlover's full-sized avatar

Thomas LE JEUNE rhumlover

  • San Francisco, California
View GitHub Profile
@rhumlover
rhumlover / thumbnails.md
Created September 9, 2014 01:00
Thumbnail calculations

Mobile Web Devices Usage

TL;DR: The final most common thumbnail sizes

133x74 (2.7%)

Samsung GT-S5360 Galaxy Y, Samsung GT-S5830i Galaxy Ace

200x112 (8.6%)

Samsung GT-18190 Galaxy S3 Mini, Nokia Lumia 520, Samsung GT-S7562 Galaxy S Duos, Samsung GT-S7582 Galaxy S Duos 2, Samsung GT-I8262 Galaxy Duos, Samsung GT-S7262 Galaxy Star S7262, Samsung GT-19100 Galaxy S2, Samsung GT-I9082 Galaxy Grand Duos

var QS = (function(loc) {
var data = {},
query = loc.search.substring(1),
vars = query.split('&'),
dUc = decodeURIComponent;
vars.forEach(function(couple) {
var pair = couple.split('='),
key = dUc(pair[0]),
value = dUc(pair[1]);
@rhumlover
rhumlover / cf.md
Last active August 29, 2015 14:10
Why CoffeeScript for a non-ruby developer?

Pros:

  • readability: so nice to get rid of semicolons and curly braces, loops are amazingly transparents
  • allows a real "class"-based work. It's perfect if you work with Backbone, for instance. Might be less true with Angular and such
  • defines some meaningful shortcuts, to create functions or closures for example. Next version of EcmaScript learned about it and will feature the "arrow" notation for functions
  • it pairs perfectly with CSS preprocessors, but mainly SASS: focus on the content, less on the appearance

Cons:

  • you need to perfectly know how JavaScript works. The CoffeeScript output is really nice, but writing it can lead to unexpected side-effects (forgot double arrow instead of single arrow), real prototype inheritance, difference between class properties, instance properties, scopes
  • you might want to focus on bad ways to improve performance. For instance, CS knows that defined functions inside loops are bad, so it will generate a function outside the loop and call it inside. If lat
(function(window, document, undefined) {
var YMHandlebars = function() {
var a = function() {
"use strict";
function a(a) {
this.string = a
}
var b;
return a.prototype.toString = function() {
@rhumlover
rhumlover / remove_files_pattern.sh
Created March 25, 2015 09:46
remove files matching a certain pattern
find . -type f -name "*conflicted copy*" -delete
Worker = require 'models/worker'
class ScopedFrame
# Private
_uniqueId = (prefix) ->
return prefix + Math.random().toString(36).slice(2)
_messageReceivedByParent = (message) ->
{origin, data} = message
@rhumlover
rhumlover / daily-arduino
Created December 1, 2012 16:43
Arduino Daily FTW !
var five = require("johnny-five"),
board, button, buttons;
board = new five.Board();
board.on("ready", function() {
var clients = {
'jonjon': 12,
'nadir': 11,
@rhumlover
rhumlover / feops 2014.md
Last active October 28, 2015 05:27
Front-End Ops 2014 sum up !
(function() {
window.streamApp.factory('Video', function() {
var Video;
Video = (function() {
function Video(attrs) {
var key, value;
for (key in attrs) {
value = attrs[key];
(function() {
window.streamApp.service('Mediator', function($rootScope, Common, Events) {
var Mediator;
Mediator = (function() {
var dict;
dict = {};
function Mediator() {}