Skip to content

Instantly share code, notes, and snippets.

View tylergannon's full-sized avatar

Tyler Gannon tylergannon

  • Monte Rio, Ca
  • 08:26 (UTC -07:00)
View GitHub Profile
@tylergannon
tylergannon / gist:1085007
Created July 15, 2011 16:20 — forked from retr0h/gist:1001477
RVM + HomeBrew + Nokogiri
BREW_HOME=$HOME/Developer
NOKOGIRI_VERSION='1.4.4'
brew install libxml2
brew link libxml2
brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/libxslt.rb
brew link libxslt
brew install libiconv
brew link libiconv
gem install nokogiri -v $NOKOGIRI_VERSION -- --with-xml2-dir=$BREW_HOME/Cellar/libxml2/2.7.8 --with-xslt-dir=$BREW_HOME/Cellar/libxslt/1.1.26 --with-iconv-dir=$BREW_HOME/Cellar/libiconv/1.13.1/
@tylergannon
tylergannon / gist:3724818
Created September 14, 2012 21:05
Freecurve Test Images File Listings
ubuntu@ip-10-252-38-113:/mnt/freecurve_org_home/images$ ls gci001
SPGRM_2012_07_01_ch2.jpg SPGRM_2012_07_16_ch2.jpg SPGRM_2012_07_31_ch2.jpg SPGRM_2012_08_15_ch2.jpg SPGRM_2012_08_30_ch2.jpg
SPGRM_2012_07_02_ch2.jpg SPGRM_2012_07_17_ch2.jpg SPGRM_2012_08_01_ch2.jpg SPGRM_2012_08_16_ch2.jpg SPGRM_2012_08_31_ch2.jpg
SPGRM_2012_07_03_ch2.jpg SPGRM_2012_07_18_ch2.jpg SPGRM_2012_08_02_ch2.jpg SPGRM_2012_08_17_ch2.jpg SPGRM_2012_09_01_ch2.jpg
SPGRM_2012_07_04_ch2.jpg SPGRM_2012_07_19_ch2.jpg SPGRM_2012_08_03_ch2.jpg SPGRM_2012_08_18_ch2.jpg SPGRM_2012_09_02_ch2.jpg
SPGRM_2012_07_05_ch2.jpg SPGRM_2012_07_20_ch2.jpg SPGRM_2012_08_04_ch2.jpg SPGRM_2012_08_19_ch2.jpg SPGRM_2012_09_03_ch2.jpg
SPGRM_2012_07_06_ch2.jpg SPGRM_2012_07_21_ch2.jpg SPGRM_2012_08_05_ch2.jpg SPGRM_2012_08_20_ch2.jpg SPGRM_2012_09_04_ch2.jpg
SPGRM_2012_07_07_ch2.jpg SPGRM_2012_07_22_ch2.jpg SPGRM_2012_08_06_ch2.jpg SPGRM_2012_08_21_ch2.jpg SPGRM_2012_09_05_ch2.jpg
SPGRM_2012_07_08_ch2.jpg SPGRM_2012_07_23_ch2.jpg SPG
[~] nslookup 13:36:52
> server ns1.xname.org
Default server: ns1.xname.org
Address: 178.33.255.252#53
> www.polestar-astrology.com.
Server: ns1.xname.org
Address: 178.33.255.252#53
** server can't find www.polestar-astrology.com: SERVFAIL
> polestar-astrology.com.
@tylergannon
tylergannon / gist:5067359
Created March 1, 2013 20:07
Lunar Date Calculations in JavaScript
var LunarDate;
LunarDate = (function() {
function LunarDate(year, month, day, hour) {
var data, days_diff, i, the_data, _i, _len, _ref;
this.year = year;
this.month = month;
this.day = day;
@tylergannon
tylergannon / gist:5067370
Created March 1, 2013 20:08
Lunar Dates in CoffeeScript
class LunarDate
constructor: (@year, @month, @day, @hour) ->
i = Date.parse(@getSolarDateString())
the_data = null
for data in LunarDate.date_table
if i < data[0]
days_diff = Math.floor((i - the_data[0]) / (24 * 60 * 60 * 1000))
@epoch = the_data[1]
@tylergannon
tylergannon / gist:5240176
Created March 25, 2013 20:02
View Class for a MineSweeper Implementation.
class Game
constructor: (@size, @mines) ->
@size ?= 8
@mines ?= 10
@boom = false
@squares = (new Square(true) for num in [1..@mines])
for num in [@mines..(@size*@size)-1]
@squares.push(new Square(false))
@shuffle()
@tylergannon
tylergannon / gist:5240295
Created March 25, 2013 20:14
Gemfile for html apps
source 'https://rubygems.org'
gem 'rails', '4.0.0.beta1'
gem 'sqlite3'
group :assets do
gem 'sass-rails', '~> 4.0.0.beta1'
gem 'coffee-rails', '~> 4.0.0.beta1'
gem 'uglifier', '>= 1.0.3'
@tylergannon
tylergannon / gist:5240802
Last active December 15, 2015 09:49
Starting template for a rails app to be used for HTML app development.
# Write our own Gemfile.
file 'Gemfile', <<-CODE
source 'https://rubygems.org'
gem 'rails', '4.0.0.beta1'
group :assets do
gem 'sass-rails', '~> 4.0.0.beta1'
gem 'coffee-rails', '~> 4.0.0.beta1'
@tylergannon
tylergannon / gist:5241972
Created March 25, 2013 23:49
A hectic stylesheet
body {
padding-top: 50px;
padding-left: 80px; }
.flash {
position: absolute;
left: 0%;
font-size: 50pt;
font-family: 'VT323', cursive;
top: 0; }
@tylergannon
tylergannon / gist:5801397
Created June 17, 2013 23:21
Managing JDBC resource objects carefully
public class DBHelper {
private static String serverip = "xxx";
private static String database = "xxx";
private static String dbuser = "xxx";
private static String password = "xxx";
public static void closeConnection(Connection connection) {
try { if (connection != null) connection.close(); }
catch (Exception e) {
// Do error stuff