Skip to content

Instantly share code, notes, and snippets.

View AdrienGiboire's full-sized avatar
🥦
Plant-fueled, you can't test me!

Adrien AdrienGiboire

🥦
Plant-fueled, you can't test me!
View GitHub Profile
// Version originale
var mine = document.getElementById('mine');
var his = document.getElementById('his');
var hers = document.getElementById('hers');
// Compression naïve et théorique
var a = document.getElementById;
var mine = a('mine'),
his = a('mine'),
hers = a('mine');
var a = function() {
return document.getElementById.apply(document, arguments);
};
// Original
function forgetVar() {
myLongVariableName = 2;
}
function dontForgetVar() {
var myVeryVeryLongVariableName = 2;
}
// uglify -b
function forgetVar() {
myLongVariableName = 2;
}
function dontForgetVar() {
var a = 2;
}
@AdrienGiboire
AdrienGiboire / gist:1869000
Created February 20, 2012 12:27
Debug BT Flash client
Warning: addEventListener is not a function
Warning: addEventListener is not a function
Warning: createAccessibilityImplementation is not a function
Warning: _endInit is not a function
Warning: 'mx' has no property 'setDataProvider'
Warning: 'mx' has no property 'getDataProvider'
Warning: 'mx' has no property 'addItem'
Warning: 'mx' has no property 'addItemAt'
Warning: 'mx' has no property 'removeAll'
Warning: 'mx' has no property 'removeItemAt'
*******Show room info 2
*******Get room info : http://preprod.blindtest.com/xml/room_infos/2.xml?lang=fr&server_id=1&key=4880
Join by simple click
locked undefined
joinRoom
roomSelected.id 2
roomSelected.eventSy undefined
joinRoom: roomId:2 pwd: undefined force:undefined
*** getRoomInfo ***
id 2
@AdrienGiboire
AdrienGiboire / iVim.rb
Created June 27, 2012 15:00
Install Vim 7.3 on MacOSX Lion
separator = String.new
8.times { separator += '-' }
separator = "\n" + separator + "\n"
def newblock(text)
puts "\n#{separator}" + text + + "#{separator}\n"
end
newblock "Prerequisites (iconv)"
if not system("which iconv")
@AdrienGiboire
AdrienGiboire / vim7.3_mac_install.rb
Created June 27, 2012 15:08 — forked from sirupsen/vim7.3_mac_install.rb
Script to install Vim 7.3 with ruby support for Mac OS X Lion
# requires root permissions in /usr/bin/
star = String.new
8.times { star += "*" }
Star = "\n#{star * 3}\n"
def newblock string
puts "\n#{Star}#{string}#{Star}\n"
end
#!/usr/bin/env ruby
require 'sinatra/base'
require './models/data'
require './models/business'
class EphemereApplication < Sinatra::Base
get '/' do
business.display_home
end