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
bind "^R" em-inc-search-prev |
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 Foo(Bar): │ | |
" └── [ 13 ] ────• | |
set fillchars="fold: " | |
setlocal foldtext=ManualFillCharText() | |
function! ManualFillCharText() | |
" TODO: make it support the tabs/spaces/different width | |
let total = (v:foldend - v:foldstart) |
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
#!/bin/bash | |
# make sure cmatrix is installed | |
# make sure tmux is installed | |
# $ chmod 755 matrix | |
# $ ./matrix | |
SESSION=$USER | |
tmux -2 new-session -d -s $SESSION 'cmatrix' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Chat!</title> | |
<style> | |
</style> | |
</head> | |
<body> | |
<ul id="messages"></ul> |
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 love.load() | |
reset() | |
topscore = 0 | |
local font = love.graphics.newFont(24) | |
love.graphics.setFont(font) | |
end | |
function reset() | |
x = 60 | |
y = love.window.getHeight()/2 |
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 sys | |
import ast | |
is_if = lambda s: isinstance(s, ast.If) | |
is_for = lambda s: isinstance(s, ast.For) | |
is_call = lambda s: isinstance(s, ast.Call) | |
call_name_is = lambda s, n: is_call(s) and hasattr(s.func, 'attr') and s.func.attr == n | |
has_else = lambda s: is_if(s) and len(s.orelse) > 0 | |
is_return = lambda s: isinstance(s, ast.Return) | |
is_name = lambda s: isinstance(s, ast.Name) |
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 Entity(object): | |
def __init__(self, name): | |
self.name = name | |
class Powered(object): | |
def is_on(self): | |
return self.state == 'on' | |
class Machine(Entity, Powered): | |
def __init__(self, name, state): |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Reddit JSON</title> | |
<style> | |
body{ background-color: #C6C6C6; } | |
#content div { | |
border: 1px solid #000000; | |
margin: 5px; | |
padding: 5px; |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Sup</title> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script type="text/javascript"> | |
window.onload = function(){ | |
var schema = { | |
fields: [ | |
{name: 'first_name', type: 'text', display: 'First Name'}, |
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 operator | |
import collections | |
class Rule(object): | |
def __init__(self, logic, left=None, right=None, op=None, inv=False): | |
self.logic = logic | |
self.left = left | |
self.right = right | |
self.op = op | |
self.inv = inv |