Skip to content

Instantly share code, notes, and snippets.

View robbiet480's full-sized avatar
😩
terminally online

Robbie Trencheny robbiet480

😩
terminally online
View GitHub Profile
package main
import (
"encoding/json"
"fmt"
_ "github.com/bmizerany/pq"
"github.com/drone/routes"
"github.com/jmoiron/sqlx"
"io"
"log"
@robbiet480
robbiet480 / bookmarklet.js
Created February 5, 2013 02:40
Reveal Password bookmarklet
javascript:(function()%7Bvar%20IN%20=%20document.getElementsByTagName(%22input%22);for(var%20i=0;%20i<IN.length;%20++i)%7BF%20=%20IN%5Bi%5D;if%20(F.type.toLowerCase()%20==%20%22password%22)%7Bif(document.all)%7Bvar%20n%20=%20document.createElement(%22input%22);for(var%20k%20in%20F.attributes)%20if(k.toLowerCase()%20!=%20'type')%7Btry%7Bn%5Bk%5D%20=%20F%5Bk%5D%7Dcatch(err)%7B%7D%7D;F.parentNode.replaceChild(n,F);%7Delse%7BF.type=%22text%22%7D%7D%7D%7D)()
@robbiet480
robbiet480 / run_me.sh
Last active December 11, 2015 14:58
Added an if for pls, assuming stream is mp3.
#!/bin/bash
filename=$(basename "$1")
extension="${filename##*.}"
filename="${filename%.*}"
if [ "$extension" = "m3u" ]
then
extension="mp3"
fi
if [ "$extension" = "pls" ]
<html>
<head>
<title>KanyeWestsBaby.com</title>
<meta name="description" content="This is an example of a description. This will often show up in search results.">
<meta name="keywords" content="Kanye West, Kanye, Kimye, Kim Kardashian, Amber, Amber Rose" >
<!-- Copy paste Google Analytics code in here-->
</head>
<body>
<h1>KanyeWestsBaby.com</h1>
<p>Interested in buying this domain? Contact [email protected]</p>
#!/usr/bin/env bash
sed -i "s|REPLACE_WITH_REAL_KEY|782eb4b6c5c6a3fd76ba7dcb36b9931f1ec4b614|g" /app/local/etc/newrelic.cfg
@robbiet480
robbiet480 / gist:2719640
Created May 17, 2012 15:27
available stock info
{ symbol: 'AAPL',
Ask: '539.58',
AverageDailyVolume: '23853900',
Bid: '539.43',
AskRealtime: '539.58',
BidRealtime: '539.43',
BookValue: '109.626',
Change_PercentChange: '-6.495 - -1.19%',
Change: '-6.495',
Commission: null,
When running:
t timeline @robbie --csv --number 3000
I get:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1060:in `request': undefined method `closed?' for nil:NilClass (NoMethodError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:772:in `get'
from /Library/Ruby/Gems/1.8/gems/faraday-0.8.0/lib/faraday/adapter/net_http.rb:70:in `perform_request'
from /Library/Ruby/Gems/1.8/gems/faraday-0.8.0/lib/faraday/adapter/net_http.rb:35:in `call'
@robbiet480
robbiet480 / Trim.txt
Created February 20, 2012 07:17
Enable TRIM for Mac
TRIM can be enabled by using the following Terminal commands. Copy these commands and run them in Terminal:
Backup the file that you’re about to patch:
sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /IOAHCIBlockStorage.original
Patch the file to enable TRIM support:
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00).{9}(\x00\x51)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
robbie-trenchenys-imac ओम् ~/Repos/messagefly/node_modules/hook.io-irc:(4d2h32m|git@master!)
1291 ± node bin/irc ✭
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: ECONNREFUSED, Connection refused
at Socket._onConnect (net.js:601:18)
at IOWatcher.onWritable [as callback] (net.js:186:12)
robbie-trenchenys-imac ओम् ~/Repos/messagefly/node_modules/hook.io-irc:(4d2h32m|git@master!)
<?xml version="1.0"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/kml/2.2 http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd http://www.google.com/kml/ext/2.2 http://code.google.com/apis/kml/schema/kml22gx.xsd">
<Document id="BART04282011">
<author>
<name>Bay Area Rapid Transit District</name>
</author>
<link href="http://api.bart.gov/kml/"/>
<name>BART System</name>
<Snippet>BART system KML including station locations, station entrances, and approximate track layout.</Snippet>
<Folder id="Routes">