Skip to content

Instantly share code, notes, and snippets.

View jonathan-ostrander's full-sized avatar

Jonathan Ostrander jonathan-ostrander

View GitHub Profile
<!DOCTYPE html>
<!-- saved from url=(0066)http://ihatetomatoes.net/demos/simple-parallax-scrolling-tutorial/ -->
<html class="js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms no-csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths no-ie8compat skrollr skrollr-desktop" style=""><!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Demo - Simple parallax scrolling tutorial</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maxi
@jonathan-ostrander
jonathan-ostrander / youporntweeter.py
Last active April 15, 2017 02:27
Tweets random YouPorn Comments
import random
import requests
from bs4 import BeautifulSoup as bsoup
import tweepy
def findTweet():
tweet = ""
while True:
r = requests.get("http://www.youporn.com/random/video/")
pornsoup = bsoup(r.text)
@jonathan-ostrander
jonathan-ostrander / output.txt
Last active August 29, 2015 14:16
Find "alphabet swap" words with python.
avez
azaz
clox
girt
grit
hovels
iver
izar
klop
levo
@jonathan-ostrander
jonathan-ostrander / averageBreweryRatings.js
Created April 16, 2015 03:56
Script to run on an exported Untappd JSON file that is open in Chrome to get your average brewery ratings.
Array.prototype.average = function () {
var sum = 0, j = 0;
for (var i = 0; i < this.length, isFinite(this[i]); i++) {
sum += parseFloat(this[i]); ++j;
}
return j ? sum / j : 0;
};
var loadJSON = function() {
return JSON.parse(document.getElementsByTagName("pre")[0].innerHTML);
@jonathan-ostrander
jonathan-ostrander / U
Created October 14, 2015 23:15
OpenFOAM case for venting loadlock
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
@jonathan-ostrander
jonathan-ostrander / .zshrc
Created April 6, 2016 14:41
Setting up oh-my-zsh in vagrant and docker
export ZSH=/home/vagrant/.oh-my-zsh
ZSH_THEME="miloshadzic"
alias ohmy="docker build -t bamx/base -f conf/webapp/OhMyDocker conf;"
alias whale="docker exec -it bamx_web_1 zsh"
plugins=(git)
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
@jonathan-ostrander
jonathan-ostrander / .gitignore
Last active December 7, 2016 21:57
Stats V1 vs V2
.DS_Store
@jonathan-ostrander
jonathan-ostrander / main.go
Last active December 21, 2016 18:26
DFS Go solution to Eschaton
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
)
// RouteState represents the current state of a given route
@jonathan-ostrander
jonathan-ostrander / Makefile
Created March 24, 2017 15:17
Local scoping
test:
npm install -g jasmine
jasmine test1.js test2.js
FORCE:
import scala.io.Source
def findGroup(v: String, groups: Map[String, Set[String]]): Set[String] = {
def loop(toVisit: Set[String], visited: Set[String]): Set[String] = (toVisit -- visited) match {
case v if v.isEmpty => visited
case v => loop(v.flatMap(n => groups.get(n).getOrElse(Set.empty[String])), visited ++ v)
}
loop(Set(v), Set.empty[String])
}