Skip to content

Instantly share code, notes, and snippets.

View jamestrimble's full-sized avatar

James Trimble jamestrimble

View GitHub Profile
#!/usr/bin/env python3
import random
from ortools.sat.python import cp_model
def generatePreferences(n, m):
'''
n - teams
m - customers
Randomly Generates Preferences of customer for n teams.
@skeeto
skeeto / README.md
Last active September 23, 2024 02:16
AI driving simulation
@yuizumi
yuizumi / easy_scanner.py
Created December 9, 2013 14:57
A poor-man's Scanner in Python, provided as a function that takes a file object and returns an iterator whose next() works like Java's Scanner.next().
def EasyScanner(reader):
return (word for line in reader for word in line.split())
# License: CC0 1.0 Universal
# http://creativecommons.org/publicdomain/zero/1.0/
@cpbotha
cpbotha / dropshadow.js
Last active March 20, 2025 01:02
d3.js drop shadow example
// d3.js drop shadow example
// put together by http://charlbotha.com/
var items = [
{x : 50, y : 10},
{x : 100, y: 170},
{x : 320, y: 70}
];
// we can increase this, everything will scale up with us
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@kogakure
kogakure / .gitignore
Last active November 19, 2024 13:22
Git: .gitignore file for LaTeX projects
*.acn
*.acr
*.alg
*.aux
*.bak
*.bbl
*.bcf
*.blg
*.brf
*.bst