Skip to content

Instantly share code, notes, and snippets.

View evan-goode's full-sized avatar

Evan Goode evan-goode

View GitHub Profile
@evan-goode
evan-goode / or.js
Last active December 9, 2015 04:39
function or(array) {
var probability = 0
var combos = []
for(var i = 1; i < array.length + 1; i++) {
var combinations = getCombinations(array, i)
for(var j = 0; j < combinations.length; j++) {
combos.push(combinations[j])
}
}
@evan-goode
evan-goode / weather-emoji.sh
Created February 10, 2016 03:30
returns an emoji representing the current weather conditions in a specified location
#!/bin/bash
woeid="2390183"
weather=`curl --silent "http://xml.weather.yahoo.com/forecastrss?w=${woeid}&u=f" | xmllint --xpath "string(//*[local-name()='condition']//@code)" -`
# codes from https://developer.yahoo.com/weather/documentation.html#codes
case "$weather" in
0) # tornado
emoji="🌪" # cloud with tornado
;;
@evan-goode
evan-goode / goodbye.js
Created February 17, 2016 19:38
userscripts
var script = document.createElement("script")
script.id = "goodbye"
script.innerHTML = " \
window.onbeforeunload = null \
"
document.documentElement.appendChild(script)
#!/usr/bin/env python3
import json
import math
import random
import yaml
import dominate
from dominate.tags import *
def load_yaml (filename):
@evan-goode
evan-goode / a-bad-way-to-calculate-probabilities.markdown
Created October 28, 2018 03:52
a bad way to calculate probabilities
@evan-goode
evan-goode / index.html
Created October 28, 2018 04:12
minecraft stronghold finder
<input placeholder="X #1" id="a-y">
<input placeholder="Z #1" id="a-x">
<input placeholder="˚ #1" id="a-angle">
<br><br>
<input placeholder="X #2" id="b-y">
<input placeholder="Z #2" id="b-x">
<input placeholder="˚ #2" id="b-angle">
<br><br>
<button id="go">go</button>
<pre id="result"></pre>
@evan-goode
evan-goode / script.babel
Created October 28, 2018 04:13
TSA Randomizer
const arrows = {
right: 'https://upload.wikimedia.org/wikipedia/commons/1/12/Right_arrow.svg',
left: 'https://upload.wikimedia.org/wikipedia/commons/1/18/Left_arrow.svg'
}
let timeout;
document.addEventListener('click', () => {
document.body.style.backgroundImage = `url(${Math.round(Math.random()) ? arrows.left : arrows.right})`;
clearTimeout(timeout);
timeout = setTimeout(() => {
DBG<1> lib/cache_mngt.c:271 nl_cache_mngt_register: Registered cache operations genl/family
polybar|info: Parsing config file: /home/evan/.config/polybar/config
polybar|trace: config_parser: Parsing /home/evan/.config/polybar/config
polybar|info: Enabling xresource manager
polybar|info: Environment var reference ${MONITOR} found (value=eDP-1)
polybar|info: Loaded monitor eDP-1 (2880x1800+0+0)
polybar|info: Found matching X resource "color0" (value=#0a0a0f)
polybar|info: Found matching X resource "color7" (value=#d6cdd8)
polybar|info: Bar geometry: 2880x60+0+0; Borders: 0,0,0,0
polybar|trace: bar: Attach X event sink