Skip to content

Instantly share code, notes, and snippets.

View gist:5ff51ef623ff464c870b4f1b0a08e3ed
https://stackoverflow.com/questions/1459150/how-to-undo-git-commit-amend-done-instead-of-git-commit
# Move the current head so that it's pointing at the old commit
# Leave the index intact for redoing the commit.
# HEAD@{1} gives you "the commit that HEAD pointed at before
# it was moved to where it currently points at". Note that this is
# different from HEAD~1, which gives you "the commit that is the
# parent node of the commit that HEAD is currently pointing to."
git reset --soft HEAD@{1}
View stickerMeServerSetup.sh
crfasrnnDir="${HOME}/crfasrnn"
serverSetupDir="${HOME}/serverSetup"
# install git if not installed
if ! hash git 2>/dev/null; then
apt-get install -y git
fi
#install unzip if not installed
if ! hash unzip 2>/dev/null; then
View gist:be1b6eb04d05b3333490185f8883c072
screen -ls | grep Detached | cut -d. -f1 | awk '{print $1}' | xargs kill
@finder39
finder39 / Makefile.config
Last active Dec 23, 2016
caffe makefile that hopefully works
View Makefile.config
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# 32 bit / 64 bit indexing
USE_INDEX_64 := 1
# GreenTea (ViennaCL/OpenCL) backend switch
# Enable the CUDA backend
# USE_CUDA := 1
@finder39
finder39 / gist:82ebafbfce5569482ef5
Created Dec 9, 2015
Add new Xcode UUID to plugins
View gist:82ebafbfce5569482ef5
Get new UUID of Xcode with
`defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
Then put into Info.plist of plugins located at:
`~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins`
View gist:a919413a1ca8ad1c879b
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@finder39
finder39 / gist:4f0f8b1972c677381631
Created Mar 7, 2015
Remove ll types of files from git repo
View gist:4f0f8b1972c677381631
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
http://stackoverflow.com/questions/107701/how-can-i-remove-ds-store-files-from-a-git-repository
View gist:24cc271adc6c127fc890
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
View gist:dc77e2693d71faf9f691
{
init: function(elevators, floors) {
var getByFloor = function (value) {
var result = floorsWaiting.filter(function(o){return o.floorNum == value;} );
return result? result[0] : null; // or undefined
}
var getElevatorById = function (arr, value) {
var result = arr.filter(function(o){return o.iden == value;} );
return result? result[0] : null; // or undefined
}
View jsonDictionaryHelpers.swift
import Foundation
func getBool(object:AnyObject?) -> Bool? {
if let temp = object as? Bool {
return temp
} else if let temp = object as? NSNumber {
return temp.boolValue
} else if let temp = object as? Int {
return Bool(temp)
} else if let temp = object as? String {