Skip to content

Instantly share code, notes, and snippets.

View chuckwagoncomputing's full-sized avatar

David Holdeman chuckwagoncomputing

View GitHub Profile
@chuckwagoncomputing
chuckwagoncomputing / threePseudonymsMaybe.rb
Last active December 14, 2016 17:20
FOAC Strategy: Keeps track of who has three pseudonyms, with a 50% chance of remembering
# Keep track of who has three pseudonyms
class StrategythreePseudonymsMaybe
def initialize(parent)
@strategy = parent
@player = @strategy.player
@memory = @strategy.memory
end
def remember(calledName, calledTeam, calledPosition, calledPseudonym, callerName)
# if someone called a number being remembered
@chuckwagoncomputing
chuckwagoncomputing / qualitativeThree.rb
Last active December 14, 2016 17:21
FOAC Strategy: Keeps track of who has three pseudonyms, forgetting one in order to remember a better one
# Keep track of who has three pseudonyms, forgetting one in order to remember a better one
class StrategyqualitativeThree
def initialize(parent)
@strategy = parent
@player = @strategy.player
@memory = @strategy.memory
end
def remember(calledName, calledTeam, calledPosition, calledPseudonym, callerName)
# if someone called a number being remembered
@chuckwagoncomputing
chuckwagoncomputing / excuses.sh
Created November 28, 2015 01:14
BOFH excuses
#!/usr/bin/env bash
EXCUSES="/path/to/excuses.txt"
awk 'NR=='$((1 + $RANDOM % `nl $EXCUSES | tail -n 1 | awk '{print $1}' `))'{print;exit}' $EXCUSES
@chuckwagoncomputing
chuckwagoncomputing / README.md
Last active November 28, 2015 01:20
WebAdd - Add up dollar values from a website

WebAdd

Script to add up dollar values from a website

webadd Test Example

webadd gets the dollar value from every line and adds them. If there is more than one dollar value on a line. you can select which one you want. Spaces or other characters between the dollar sign and numbers are not allowed.

@chuckwagoncomputing
chuckwagoncomputing / main.c
Last active October 27, 2018 00:48
Bobcat 225G welder idle controller
//*****************************************************//
// welder.c //
// 2016-4-11 //
// Written By David Holdeman //
// Miller Bobcat 225G Idle Solenoid Controller //
//*****************************************************//
// ATtiny45/85
// +-------+
// !RESET |* | VCC
@chuckwagoncomputing
chuckwagoncomputing / greed.rb
Created November 23, 2016 19:04
How much more likely are you to roll 6 dice uniquely than all the same?
greed = 0
flush = 0
10000000.times do
dice = []
6.times do
dice.push((1..6).to_a.sample)
end
if dice.include?(1) and dice.include?(2) and dice.include?(3) and dice.include?(4) and dice.include?(5) and dice.include?(6)
greed += 1
elsif dice[0] == dice[1] and dice[1] == dice[2] and dice[2] == dice[3] and dice[3] == dice[4] and dice[4] == dice[5]
@chuckwagoncomputing
chuckwagoncomputing / qualitativeThreeCouchCaller.rb
Last active December 14, 2016 17:24
FOAC Strategy: qualitativeThree, now with a preference for the person called by the first person on the couch.
# Keep track of who has three pseudonyms, forgetting one in order to remember a better one
class StrategyqualitativeThreeCouchCaller
def initialize(parent)
@strategy = parent
@player = @strategy.player
@memory = @strategy.memory
end
def remember(calledName, calledTeam, calledPosition, calledPseudonym, callerName)
# if someone called a number being remembered
@chuckwagoncomputing
chuckwagoncomputing / age.lua
Created December 27, 2016 04:09
A function to get fractional age for my conky
function conky_get_age(year, month, day)
if conky_window == nil then
return
end
daystoday = os.date("%j")
daysatbirth = os.date("%j", os.time{year=year, month=month, day=day})
yearsold = os.date("%Y") - os.date("%Y", os.time{year=year, month=month, day=day})
if daysatbirth > daystoday then
yearsold = math.floor(yearsold - 1)
dayssince = (365 - daysatbirth) + daystoday
@chuckwagoncomputing
chuckwagoncomputing / reclaimWindows10.ps1
Last active March 21, 2020 18:45 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
@chuckwagoncomputing
chuckwagoncomputing / nginx.conf
Last active February 13, 2017 21:21 — forked from mimosz/nginx.conf
nginx + unicorn + padrino on ubuntu
# sudo ln -s ~/nginx.conf unicorn.conf
upstream app_server {
server unix:/tmp/unicorn_padrino.sock fail_timeout=0;
}
server {
listen 80;
charset utf-8;
server_name db.innshine.com;