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
function logStyles() {
var doc_style = document.body.style;
console.log(doc_style.border,
doc_style.margin,
doc_style.padding);
}
function logStyles() {
var a = document.body.style;
console.log(a.border, a.margin, a.padding);
};
// 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")