Skip to content

Instantly share code, notes, and snippets.

View adamryman's full-sized avatar

Adam Ryman adamryman

View GitHub Profile
@adamryman
adamryman / Application.xml
Created April 27, 2012 04:06
Livu Wowza Setupfile
<Root>
<Application>
<!-- Uncomment to set application level timeout values
<ApplicationTimeout>60000</ApplicationTimeout>
<PingTimeout>12000</PingTimeout>
<ValidationFrequency>8000</ValidationFrequency>
<MaximumPendingWriteBytes>0</MaximumPendingWriteBytes>
<MaximumSetBufferTime>60000</MaximumSetBufferTime>
<MaximumStorageDirDepth>25</MaximumStorageDirDepth>
-->
@adamryman
adamryman / 0_reuse_code.js
Created July 23, 2014 21:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

ambition

ambition is an action tracker for the purpose of quantitative self and habit tracking.

The core will be database with a useful structure and an api that can be accessed by many different interfaces for both data input and viewing.

Table structure

Users have Sets, Sets have Actions, and Actions have Occurrences.

#!/bin/bash
function gophersay {
# base64 encoded then gzipped golang gopher ascii art
# from here: https://gist.github.com/belbomemo/b5e7dad10fa567a5fe8a
gopherart="H4sIAJ73h1cAA32OSxLCIBBE95yiy40VCoNHYOsZggyruMnGPebs9pCPSSztED49bxpw+SEDIOo0
z4j8nbAyqhRpBYuIiHPibBJq8nQnOduHjSfriHhaHv5cq6kFjTk5hSfXHqYDQo+C0DRaKVj3A3AF
25kTszbGsV6loYj1Lr8809TOVTIIx8a4Tczr43Q1QO57iMzWYWjZBevhyGDk983s2o4q03v+QpUx
b+lcNw2vAQAA
"
@adamryman
adamryman / -etc-sudoers
Created July 20, 2016 16:31
My sudoers file that allows all users that are in the sudo group to sudo without password
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
@adamryman
adamryman / ag-replace.sh
Created October 31, 2016 23:02
`ag -Qs "THIS"`, I want to replace all occurrences of "THIS" with "THAT". `Just do ag-replace "THIS" THAT"`
#!/bin/bash
usage() {
echo "Usage: $(basename $0) \"THIS\" \"THAT\"";
echo "Outputs files modified"
exit 1;
}
replace() {
@adamryman
adamryman / short-circuit.go
Created November 1, 2016 18:36
Trying out golang short circuits
package main
import "fmt"
func main() {
// false
fmt.Println(shortCircuit())
// panic
fmt.Println(brokenCircuit())
}
@adamryman
adamryman / closure.go
Created November 23, 2016 21:07
this is how we closure
package main
func main() {
var test closure
test = foo
for {
test = test()
}
}
@adamryman
adamryman / randman.sh
Last active December 22, 2016 01:44
Gives you a random man page of one of the executables in your path
#!/bin/bash
# randman, gives you a random man page from your path
# Copy the line below to your .bashrc to add a simple alias
# alias randman="until for binpath in ${PATH//:/$' '}; do ls ${binpath}; done | shuf | head -1 | xargs man; do :; done"
until
for binpath in ${PATH//:/$' '}; do
ls ${binpath};
@adamryman
adamryman / gobuild-count-time.sh
Created December 24, 2016 03:22
Build a go project and count how many seconds have passed then print `time` that it took.
a=1; done=0; while [[ ! -e "./__done__" ]]; do sleep 1; echo $a; a=$(($a+1)); done & time go build ./... && touch __done__ && sleep .99 && rm __done__