Skip to content

Instantly share code, notes, and snippets.

View rixth's full-sized avatar

Thomas Rix rixth

View GitHub Profile

Logical Fallacies

Content reformatted from yourlogicalfallacyis.com.

ad hominem

Attacking your opponent's character or personal traits instead of engaging with their argument.

After Sally presents an eloquent and compelling case for a more equitable taxation system, Sam asks the audience whether we should believe anything from a woman who isn't married, was once arrested, and smells a bit weird.

Oh this shiny new computer– –
There just isn’t nothin’ cuter.
It knows everything the world ever knew.
And with this great computer
‘Cause there ain’t a single thing that it can’t do.
It can sort and it can spell,
It can punctuate as well.
It can find and file and underline and type.
It can edit and select,
It can copy and correct,
@rixth
rixth / gist:5443497
Created April 23, 2013 13:22
WWDC ticket monitor
require 'pagerduty'
require 'nokogiri'
require 'open-uri'
URL_TO_MONITOR = 'https://developer.apple.com/wwdc/'
PAGERDUTY_SERVICE_KEY = 'xxx'
pagerduty = Pagerduty.new(PAGERDUTY_SERVICE_KEY)
previous_html = nil
#### Contents of the preconfiguration file (for &releasename;)
### Localization
# Locale sets language and country.
d-i debian-installer/locale string en_US
# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
#d-i console-setup/modelcode string pc105
d-i console-setup/layoutcode string us
@rixth
rixth / git-integrate.zsh
Created March 1, 2013 21:55
Usage: git-integrate base-branch <branches-to-merge>*
function git-integrate () {
integration_branch="integration_$RANDOM"
base_branch=$1
delete_integration_branch () {
echo "Checking back out to $base_branch"
git checkout $base_branch
echo "Deleting integration branch $integration_branch"
git branch -D $integration_branch
}
@rixth
rixth / function.zsh
Created December 11, 2012 05:13
A shell function to duplicate a VMWare Fusion 5 virtual machine, including renaming the innards.
function duplicate_vm() {
local from_name=$1
local to_name=$2
cp -r $from_name.vmwarevm $to_name.vmwarevm
pushd $to_name.vmwarevm > /dev/null
rm vmware*.log
mv $from_name.nvram $to_name.nvram
#!/usr/bin/env ruby
repo = `basename \`git rev-parse --show-toplevel\``.strip
sha = `git rev-parse HEAD`.strip
file= "~/Dropbox/Code/gitshots/#{Time.now.to_i}-#{repo}-#{sha}.jpg"
puts "Taking capture into #{file}!";
system "imagesnap -q -w 3 #{file} &";
exit 0
@rixth
rixth / random-mac.zsh
Created August 21, 2012 05:39
Want to assume a new identity on a network? This function will give you a random (non-multicast) MAC address.
function random-mac() {
local interface="${1:-en0}"
local old_addr=`ifconfig $interface |grep ether|awk '{print $2}'`
local new_addr=`ruby -e "puts ('%02x' % ((rand 64)*4|2))+(0..4).inject('') {|s,x| s + ':%02x' %(rand 256)}"`
`sudo ifconfig $interface ether $new_addr`
if [ $? -eq 0 ]; then
echo "Switched mac address on $interface to $new_addr from $old_addr"
else
echo "FAILED TO SWITCH MAC ADDRRESS ON $interface"
fi
@rixth
rixth / Bencoding.h
Created July 22, 2012 02:57
A very naive bencoding decoder I wrote for a personal project.
//
// Bencoding.h
// bencoder
//
// Created by Thomas Rix on 7/21/12.
// Copyright (c) 2012 Thomas Rix. All rights reserved.
//
#import <Foundation/Foundation.h>
// Zepto.js
// (c) 2010, 2011 Thomas Fuchs
// Zepto.js may be freely distributed under the MIT license.
(function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===a&&(Array.prototype.reduce=function(b){if(this===void 0||this===null)throw new TypeError;var c=Object(this),d=c.length>>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);while(e<d)e in c&&(f=b.call(a,f,c[e],e,c)),e++;return f})})();var Zepto=function(){function v(a){return{}.toString.call(a)=="[object Function]"}function w(a){return a instanceof Object}function x(a){return a instanceof Array}function y(a){return typeof a.length=="number"}function z(b){return b.filter(function(b){return b!==a&&b!==null})}function A(a){return a.length>0?[].concat.apply([],a):a}function B(a){return a.repla