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 stash && git fetch origin && git reset --hard origin/master |
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
#cd to the script's directory in case it is not the current working directory | |
os.chdir(os.path.dirname(os.path.abspath(__file__))) |
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
# ADD PASSWORDS.P TO .gitignore IF USING GITHUB!! | |
import cPickle | |
def main(): | |
all_info = {'USERNAME': raw_input("username: "), | |
'PASSWORD': raw_input("password: ")} | |
cPickle.dump(all_info, open("passwords.p", "w")) |
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
class Passwords(object): | |
def __init__(self): | |
try: | |
passwords = cPickle.load(open("passwords.p")) | |
except (EOFError, IOError): | |
sys.exit("No password file (./passwords.p) found. Please run 'setup.py'.") | |
self.USERNAME = passwords['USERNAME'] | |
self.PASSWORD = passwords['PASSWORD'] |
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
if (arc4random() % 2) { | |
// 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
- (void) setup | |
{ | |
// init that can't wait for viewDidLoad | |
} | |
- (void) awakeFromNib | |
{ | |
[self setup]; | |
} |
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
import os | |
original_path = raw_input("Full path of original folder: ") | |
duplicate_path = raw_input("Full path of folder that files were copied to: ") | |
for _, __, file in os.walk(original_path): | |
original = file | |
for _, __, file in os.walk(duplicate_path): | |
duplicate = file |
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
NSArray *reversedArray = [[array reverseObjectEnumerator] allObjects]; |
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 QuizEditor(sender, quiz) | |
{ | |
this.sender = sender; | |
this.quiz = quiz; | |
ClassUtil.inherit(QuizEditor, this, QuizInterface) | |
this.initialize(); | |
} |
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
// for Google Apps Script | |
function gmailPDFUpload () | |
{ | |
var uploadedLabel = GmailApp.getUserLabelByName('uploaded'); | |
var notUploadedLabel = GmailApp.getUserLabelByName('notUploaded'); | |
var notUploadedThreads = notUploadedLabel.getThreads(); | |
for (index in notUploadedThreads) { |
OlderNewer