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 / 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,
(function() {
window.streamApp.service('Mediator', function($rootScope, Common, Events) {
var Mediator;
Mediator = (function() {
var dict;
dict = {};
function Mediator() {}
(function() {
window.streamApp.factory('Video', function() {
var Video;
Video = (function() {
function Video(attrs) {
var key, value;
for (key in attrs) {
value = attrs[key];
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView wview = (WebView) findViewById(R.id.webviewD);
wview.setWebChromeClient(new WebChromeClient(){
@Override
public void onShowCustomView(View view, CustomViewCallback callback) {
super.onShowCustomView(view, callback);
if (view instanceof FrameLayout){
var _embedder = (function(doc) {
var referrer = doc.referrer,
anchor = doc.createElement('a'),
res = [referrer];
/*
Two different ways to extract domain from url:
- for only one part, we can use a fast regexp: referrer.match(/:\/\/(.[^/]+)/)[1])
- for 2+ parts, create manually a '<a>' tag, set his href to the referrer url, and
then we can access to several url infos: protocol, hostname, port...
@rhumlover
rhumlover / lightest-video-base64.txt
Last active September 17, 2017 13:07
10 frames 8x8px black video, base64 encoded: the lightest video ever.
data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthAAGBRgj237AAAC6m1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAqAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAqAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAXcAAAAPpVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAADFZpZGVvSGFuZGxlcgAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiu4FAEQBFGMAAAGyTGF2YzUyLjIwLjEGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAA+kAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGF1ZHRhAAAAWW1ldGEAAAAAAAAAImhkbHIAAAAAAAAAAG1kaX
@rhumlover
rhumlover / vast3_error_codes.md
Created June 10, 2013 09:05
VAST 3 error codes

VAST Error Codes Table

From VAST 3.0 Spec (PDF)

Code Description
100 XML parsing error.
101 VAST schema validation error.
102 VAST version of response not supported.
200 Trafficking error. Video player received an Ad type that it was not expecting and/or cannot display.
@rhumlover
rhumlover / pretty-print-json.sh
Created June 17, 2013 11:51
Pretty-printing JSON and XML on Mac OSX
# Pretty-printing JSON and XML on Mac OSX
python -m json.tool < unformatted.json | less
@rhumlover
rhumlover / review.md
Last active December 5, 2016 23:36
Javascript Templates Comparison: Hogan, dust, doT, underscore

JavaScript Templates Engines

A quick comparison/ benchmark between Hogan, Dust, doT and underscore

Presentation and Readability

Hogan.js

Developed by Twitter (same team as Bootstrap), use exactly the same syntax as Mustache, but more performant and more stuff available server side.

My name is {{ name }}

@rhumlover
rhumlover / add_ssh_id_dsa.md
Last active December 25, 2015 20:09
Issue: git ask for password while gitconfig is correctly set Solution: add your private ssh key

Issue

git ask for password while gitconfig is correctly set

Test

$ ssh-add -L
The agent has no identities.

Solution

add your private ssh key