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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
Reverting Working Copy to an Older Commit | |
To revert to a commit that's older than the most recent commit: | |
# Resets index to former commit; replace '56e05fced' with your commit code | |
git reset 56e05fced | |
# Moves pointer back to previous HEAD | |
git reset --soft HEAD@{1} |
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
heroku pg:reset DATABASE | |
heroku run rake db:migrate | |
heroku run rake db:seed | |
http://stackoverflow.com/questions/4820549/how-to-empty-db-in-heroku |
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
[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:nil]; | |
self.testTimer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(doStuff) userInfo:nil repeats:YES]; | |
[[NSRunLoop currentRunLoop] addTimer:self.testTimer forMode:NSRunLoopCommonModes]; |
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
<script> | |
var pretag = document.createElement("pre"); | |
pretag.innerHTML = document.getElementsByTagName("html")[0].outerHTML.replace(/[\u00A0-\u9999<>\&]/gim, function(i) { | |
return '&#'+i.charCodeAt(0)+';'; | |
}); | |
document.body.appendChild(pretag); | |
</script> |
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
/******************************************************************* | |
* Copy the following code into the FRONT SIDE of any card template in Anki. | |
* | |
* Find the next comment block for the snippet for the BACK SIDE. | |
******************************************************************/ | |
<script> | |
var modifyIt = document.getElementsByTagName("body")[0]; | |
if (document.getElementsByTagName("hr").length == 0) |
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
<!-- Created for my INFO 360 project ProcrastiNo --> | |
<!-- Based on code from http://jsfiddle.net/Mandarinazul/WMLd4/ --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<body> | |
<style> | |
div { | |
font-family: Tahoma, Verdana sans-serif; | |
box-sizing: border-box; | |
-moz-box-sizing: border-box; |
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
######### | |
## Git ## | |
######### | |
# search diff of dangling commits for the word AVCaptureDevice | |
git fsck --no-reflog | awk '/dangling commit/ {print $3}' | \ | |
while read ref; do if [ "`git show -p $ref|grep -c AVCaptureDevice`" -ne 0 ]; then echo $ref ; fi ; done | |
# list git commit messages for dangling commits | |
git fsck --lost-found | grep "dangling commit" | cut -d" " -f 3 | xargs -I "{}" git show --stat "{}" # view git messages for dangling commits |
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
## homebrew | |
export PATH="/usr/local/sbin:$PATH" | |
### aliases and functions | |
alias gits='git status' | |
alias gitbr='git branch ' | |
alias reload='source ~/.bash_profile' | |
alias b_p='vim ~/.bash_profile' | |
alias grep='grep --color' | |
alias ls='ls -1' # each file/folder on it's own line |
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
<?xml version="1.0"?> | |
<root> | |
<appdef> | |
<appname>GOOGLE_CHROME</appname> | |
<equal>com.google.Chrome</equal> | |
</appdef> | |
<appdef> | |
<appname>TERMINAL</appname> |
OlderNewer