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
#!/usr/bin/env python | |
""" | |
An example of Redis shingling and intersection. | |
I should probably have like... a list of entities or something. | |
REDIS SCHEMA: |
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
#include <stdio.h> | |
#ifndef M_PI | |
#define M_PI 3.14159265358979323846264338327950288 | |
#endif | |
#define SIGNIFICAND_SIZE 52 | |
#define EXPONENT_MASK 0x7FF | |
#define SIGNIFICAND_MASK 0x000FFFFFFFFFFFFFL | |
typedef union { |
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
" Place this file in {VIMHOME}/after/ftplugin/python.vim | |
" Must have syntastic >= 3.5.0-29 | |
" Use Python 3 when the shebang calls for it. | |
let b:syntastic_python_python_exec = | |
\ syntastic#util#parseShebang()['exe'] =~# '\m\<python3' | |
\ ? 'python3' | |
\ : 'python' | |
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
# Code transliterated from | |
# https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Compatibility | |
unless String::trim | |
do -> | |
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g | |
String::trim = -> @replace(rtrim, '') | |
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.path | |
def parent(n=1): | |
""" | |
Hacky way to get the nth parent of THIS file. | |
Suppose this file was put in `/tmp/` which is symlinked to `/private/tmp`: | |
>>> parent(n=1) | |
'/private/tmp' |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
""" | |
correctd -- automatically correct clipboard selections | |
Requires: xsel, and the sh python module. | |
Ubuntu install (sudo might be required): |
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
#!/usr/bin/env python | |
#shift_js:ebcdic:utf-8:coding:rot-13:latin-1: | |
cevag(ynzoqn ___:(ynzoqn __: | |
___ (ynzoqn *_:__(__ ) ( *_) | |
)) ( ynzoqn _ : ___( ynzoqn * | |
__ : _ (_ ) (*__)))) ( ynzoqn | |
___:(ynzoqn __,____, _ : ____ | |
vs abg yra( _ ) ryfr ___ (__, | |
__(____,_ [ Snyfr]), _[Gehr:] |
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
#!/usr/bin/env ruby | |
# The Xcode prefix for C stuff. | |
PREFIX = `xcrun --show-sdk-path`.chomp | |
# Ze masterpiece. | |
def have_a_nap | |
puts "Le 💤 " | |
pause |
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
#!/usr/bin/env ruby | |
require 'ripper' | |
class Module | |
# Public: Defines a behooked getter for the given attribute names. | |
# | |
# symbols - names of the @attribute to access. | |
# | |
def attr_boolean(*symbols) |