Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
null !== undefined but null == undefined ¯\_(ツ)_/¯

Leo Lanese leolanese

💻
null !== undefined but null == undefined ¯\_(ツ)_/¯
View GitHub Profile
@leolanese
leolanese / dabblet.css
Created Nov 3, 2013
The first commented line is your dabblet’s title
View dabblet.css
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
View dabblet.css
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
View dabblet.html
<!-- content to be placed inside <body>…</body> -->
@leolanese
leolanese / dabblet.css
Created Nov 3, 2013
The first commented line is your dabblet’s title
View dabblet.css
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@leolanese
leolanese / KO_chetsheet.css
Created Mar 12, 2014
Knockout built-in Bindings Quick Reference
View KO_chetsheet.css
html, body{
margin:0;
padding:0;
height:100%;
}
section {
position: relative;
border: 1px solid #000;
padding-top: 37px;
background: #500;
@leolanese
leolanese / lynx_install
Created Mar 13, 2014
Lynx on Maverick
View lynx_install
##
## http://lynx.isc.org/
##
cd /usr/local/src
curl -O http://lynx.isc.org/lynx2.8.7/lynx2.8.7.tar.gz
tar -xzvf lynx2.8.7.tar.gz
cd lynx2-8-7
./configure --mandir=/usr/share/man
make
@leolanese
leolanese / gist:da20c39d9c8962fbf52e
Created Jul 8, 2014
DiffMerge merging tool: Installation and configuration for GIT
View gist:da20c39d9c8962fbf52e
// Download and install your version from: https://sourcegear.com/diffmerge/
// run these commands on the terminal
git config --global merge.tool diffmerge
git config --global mergetool.diffmerge.cmd "sgdm --merge --result=\$MERGED \$LOCAL \$BASE \$REMOTE"
git config --global mergetool.diffmerge.trustExitCode true
View gist:5dad6e7d80919edf1e4e
Sharing simple trick that I'm using for debuggin everyday:
0- Fluid(s)
img,object,video,embed {
max-width: 100%;
}
--
1- use Pesticide plugin:
View gist:72dbf4ff24b40b8385b7
// install the node http-server server
npm -g install http-server
// run this server:
http-server
// get the process that has bound to the required port
lsof -Pi | grep LISTEN
...
node 18740 Leo 12u IPv4 0xaf78c883a32c84bf 0t0 TCP *:8081 (LISTEN)
View gist:36fe3879dd7b97c9f63f
var betterTypeOf = function(obj) {
return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase()
}
/*
betterTypeOf(null); // null
betterTypeOf(NaN); // number
betterTypeOf({a: 4}); //"object"
betterTypeOf([1, 2, 3]); //"array"
(function() {console.log(toType(arguments))})(); //arguments