This file contains hidden or 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
| #!/usr/bin/env python | |
| import subprocess | |
| p = subprocess.Popen(["git", "log", "--format='%s'"], stdout=subprocess.PIPE) | |
| out, err = p.communicate() | |
| # Keep going until we don't find a "fixup! " | |
| fixup_count = 0 | |
| max_list_size = 10 | |
| commits = out.split('\n')[:max_list_size] |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import subprocess | |
| import os | |
| F_DEVNULL = open(os.devnull, 'w') | |
| p = subprocess.Popen(["git", "rev-parse", "--show-toplevel"], | |
| stdout=subprocess.PIPE, stderr=F_DEVNULL) | |
| repo_root, err = p.communicate() | |
| repo_root = repo_root.strip() |
This file contains hidden or 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
| " Lets me know how much time I've spent editing a file | |
| " Keyboard shortcut -> \dt | |
| augroup TimeSpentEditing | |
| au! | |
| au BufWinEnter * if !exists('b:tstart')|let b:tstart=reltime()|en | |
| augroup END | |
| function! TimeSpentEditing() | |
| let secs = str2nr(reltimestr(reltime(b:tstart))) | |
| let hours = secs / 3600 |
This file contains hidden or 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
| jarnal $(date +"notes_%b_%d_%Y.jaj" | tr '[:upper:]' '[:lower:]') |
This file contains hidden or 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
| # File: jaj2pdf | |
| # Quickly convert jarnal files to pdf. Page dimensions don't seem to be | |
| # preserved unfortunately | |
| #!/bin/bash | |
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| java -Xms64m -Xmx512m -jar $DIR/jarnalDir/jarnal.jar -pdf - $1 | |
| # File: jarnal | |
| # Open up jarnal! | |
| #!/bin/bash |
This file contains hidden or 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 () { | |
| var t; | |
| (function (t, e, i) { | |
| function n(i, s) { | |
| if (!e[i]) { | |
| if (!t[i]) { | |
| var r = "function" == typeof require && require; | |
| if (!s && r) return r(i, !0); | |
| if (o) return o(i, !0); | |
| throw Error("Cannot find module '" + i + "'") |
This file contains hidden or 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 () { | |
| var t; | |
| (function (t, e, i) { | |
| function n(i, s) { | |
| if (!e[i]) { | |
| if (!t[i]) { | |
| var r = "function" == typeof require && require; | |
| if (!s && r) return r(i, !0); | |
| if (o) return o(i, !0); | |
| throw Error("Cannot find module '" + i + "'") |
This file contains hidden or 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
| >>> # Suppose we have this list of tuples, each of length two. | |
| ... # Element 1 is a persons first name, element 2 is their last name | |
| ... | |
| >>> names = [('Joseph', 'McCullough'), ('Luke', 'PolishLastName')] | |
| >>> # Now, if we do a normal for loop, the item per each iteration is | |
| ... # a tuple | |
| ... | |
| >>> for name in names: | |
| ... print("first: " + name[0]) | |
| ... print("last: " + name[1]) |
This file contains hidden or 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 this email ends up in your spam folder move it to your inbox so links and | |
| attachments would be active, you won't regret it!!! | |
| Instead of $660* just $19.99( | |
| look here! | |
| [link removed] | |
| ), special Christmas offer, check the attachments! |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import sys | |
| import subprocess | |
| if len(sys.argv) != 2: | |
| exit("Improper usage. Do pytest test/path/to/tests.someTestCase.some_test") | |
| command_list = ["python", "manage.py", "test"] | |
| test_path = sys.argv[1].replace("/", ".") | |
| command_list.append(test_path) |