This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkmanagementcommand(){ | |
# creates a new management command | |
# arg1: app name | |
mkdir $1/management; | |
touch $1/__init__.py; | |
mkdir $1/management/commands; | |
touch $1/management/commands/__init__.py; | |
touch $1/management/commands/$2.py; | |
} | |
add_ci(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sleep(milliseconds) { | |
var start = new Date().getTime(); | |
for (var i = 0; i < 1e7; i++) { | |
if ((new Date().getTime() - start) > milliseconds){ | |
break; | |
} | |
} | |
} | |
// sleep(1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_ascii(str){ | |
for (var i = 0; i < str.length; i++) | |
if (str.charCodeAt(i) > 127) | |
return false; | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- html --> | |
<link rel="stylesheet" type="text/css" | |
href="https://fonts.googleapis.com/css?family=Lato"> | |
<!-- css --> | |
body{ | |
font-family: 'Lato', serif; | |
font-size: 110%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.foo{ | |
animation: foo_ani 1s; | |
} | |
@keyframes foo_ani{ | |
0%{ | |
background-color: #53E889; | |
} | |
100%{ | |
background-color: #AAF9C6; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find / -name foo.bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa && cat ~/.ssh/id_rsa.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- button to delete an object --> | |
<% @foo.each do |f| %> | |
<%= button_to 'delete', f, method: :delete %> | |
<% end %> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on("mouseenter", ".foo", function(){ | |
console.log("do something"); | |
}); | |
// for jquery versions < 1.7 | |
$(".foo").live("click", function(){ | |
console.log("do something"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* on mouse enter */ | |
.foo:hover{ | |
} | |
/* on mouse out */ | |
.foo:not(:hover){ | |
} |