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
<?php | |
class Phergie_Plugin_PhpTest extends Phergie_Plugin_TestCase | |
{ | |
/** | |
* Tests for appropriate plugin requirements. | |
* | |
* @return void | |
*/ | |
public function testPluginRequirements() | |
{ |
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
diff --git a/IPythonReviewTime.ipynb b/IPythonReviewTime.ipynb | |
index 803d4ac..09b5662 100644 | |
--- a/IPythonReviewTime.ipynb | |
+++ b/IPythonReviewTime.ipynb | |
@@ -162,7 +162,7 @@ | |
"output_type": "pyout", | |
"prompt_number": 6, | |
"text": [ | |
- "<matplotlib.collections.LineCollection at 0x80e5f50>" | |
+ "<matplotlib.collections.LineCollection at 0x8f86f50>" |
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
from flask import Flask | |
class NBDiffFlask(Flask): | |
def set_files(self, file1, file2): | |
self.file1 = file1 | |
self.file2 = file2 | |
app = NBDiffFlask(__name__) | |
@app.route("/diff.js") |
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
# two strings | |
A = 'abcabba' | |
B = 'cbabac' | |
# Get a list of columns and their truth values. | |
[[a == b for (a, b) in list(it.product(A, B))][i*6:i*6+6] for i in range(len("abcabba"))] | |
""" | |
expected_result = [[False, False, True, False, True, False], | |
[False, True, False, True, False, False], |
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 bash | |
while [ 1 ]; | |
do | |
cp ~/test.txt ~/test.txt.old | |
EVENT=$(inotifywait --format '%e' ~/test.txt); | |
[ $? != 0 ] && exit | |
[ "$EVENT" = "MODIFY" ] && echo 'file modified!' | |
diff ~/test.txt ~/test.txt.old | |
done |
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
# Tavish Armstrong (c) 2013 | |
# | |
# make_merge_conflict.py | |
# | |
# Make a new directory, initialize a git repository within, and cause a merge conflict. | |
# Yes. On purpose. | |
import os | |
import subprocess | |
import random |
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
import lib2to3.pygram | |
import lib2to3.pgen2.driver as driver | |
class Tree(object): | |
def __init__(self, n): | |
self.n = n | |
self.used_names = set() | |
def __getitem__(self, idx): |
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
# Most General Unifier implementation | |
# - Tavish Armstrong | |
class Pred(object): | |
def __init__(self, name, args): | |
self.name = name | |
self.args = args | |
def apply(self, sub): |
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 bash | |
MODDED_FILES=$( git ls-files --modified ); | |
vim -p $MODDED_FILES |
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 bash | |
LAST_COMMIT_FILES=$( git log -1 --numstat --pretty="%h" | tail -n +3 | awk '{print $3}' ); | |
vim -p $LAST_COMMIT_FILES |
OlderNewer