Skip to content

Instantly share code, notes, and snippets.

Thomas LE JEUNE rhumlover

Block or report user

Report or block rhumlover

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rhumlover
rhumlover / countries_with_vat.txt
Created Mar 15, 2016
Countries with a VAT system
View countries_with_vat.txt
1 Austria AT
2 Belgium BE
3 Brazil BR
4 Bulgaria BG
5 Croatia HR
6 Cyprus CY
7 Czech Republic CZ
8 Denmark DK
9 Estonia EE
10 Finland FI
@rhumlover
rhumlover / update_git_index.sh
Created Nov 11, 2015
When your git is stubborn and stuck with files that don't disappear (even with reset --hard), so you can't change branch: update git indexes so git knows those files didn't change
View update_git_index.sh
git ls-files -m | xargs -I {} git update-index --assume-unchanged {}
View ScopedFrame.fancy.coffee
Worker = require 'models/worker'
class ScopedFrame
# Private
_uniqueId = (prefix) ->
return prefix + Math.random().toString(36).slice(2)
_messageReceivedByParent = (message) ->
{origin, data} = message
@rhumlover
rhumlover / remove_files_pattern.sh
Created Mar 25, 2015
remove files matching a certain pattern
View remove_files_pattern.sh
find . -type f -name "*conflicted copy*" -delete
View ym_m6.js
(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 / cf.md
Last active Aug 29, 2015
Why CoffeeScript for a non-ruby developer?
View cf.md

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
View QS.js
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 / thumbnails.md
Created Sep 9, 2014
Thumbnail calculations
View thumbnails.md

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

@rhumlover
rhumlover / feops 2014.md
Last active Oct 28, 2015
Front-End Ops 2014 sum up !
View feops 2014.md
View pointer-events.coffee
# Disable and enable event on scroll begin and scroll end.
# @see http://www.thecssninja.com/javascript/pointer-events-60fps
root = document.documentElement
timer = null
window.addEventListener 'scroll', ->
clearTimeout timer
# Pointer events has not already been disabled.
if not root.style.pointerEvents
root.style.pointerEvents = 'none'
You can’t perform that action at this time.