View gist:f90d42722b97024958859c9e3fddd663
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
conda | |
pip-tools | |
pipenv | |
poetry |
View poll-results.py
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
# Blog post: https://scribu.net/twitter-poll-analysis.html | |
import sys | |
import math | |
positive = int(sys.argv[1]) | |
z = 1.9599 # 95% confidence | |
n = 7 # number of votes | |
classes = 3 # number of possible answers |
View hlc.py
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 -*- | |
""" | |
Hierarchical link clustering | |
============================ | |
:Author: Tamás Nepusz | |
This is an implementation of the hierarchical link clustering algorithm of Ahn | |
et al. The results provided by this implementation match those of the original |
View index.html
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
<script> | |
fetch('/secrets', {credentials: 'same-origin'}).then((response) => alert('Worked!')); | |
</script> |
View deferred_acceptance.py
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
from collections import defaultdict | |
def male_without_match(matches, males): | |
for male in males: | |
if male not in matches: | |
return male | |
def deferred_acceptance(male_prefs, female_prefs): | |
female_queue = defaultdict(int) |
View monty-hall.py
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 random | |
DOORS = set([1, 2, 3]) | |
def play(picked_door, do_switch): | |
door_with_car = random.sample(DOORS, 1)[0] | |
revealed_door = random.sample(DOORS.difference([door_with_car]), 1)[0] | |
if do_switch: |
View index.html
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
<html> | |
<head> | |
<title>Negative Feedback</title> | |
<style> | |
body { | |
background: black; | |
} | |
.half { | |
float: left; |
View FCP_KeyPreset.py
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 bpy | |
import os | |
wm = bpy.context.window_manager | |
kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0]) | |
# Map View2D | |
km = kc.keymaps.new('View2D', space_type='EMPTY', region_type='WINDOW', modal=False) | |
kmi = km.keymap_items.new('view2d.scroller_activate', 'LEFTMOUSE', 'PRESS') |
View gist:951fb7ebc553d288479f
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
### Keybase proof | |
I hereby claim: | |
* I am scribu on github. | |
* I am scribu (https://keybase.io/scribu) on keybase. | |
* I have a public key whose fingerprint is 2C8A 343A FDCC DDD2 6442 CCF1 8219 7F75 BDAF B501 | |
To claim this, I am signing this object: |
View repl.js
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
// Usage: require('repl').start.call(this); | |
// Press Ctrl+D to continue script | |
// Press Ctrl+C to exit. | |
require = patchRequire(require); | |
var system = require('system'); | |
var utils = require('utils'); | |
exports.start = function(prompt) { |
NewerOlder