Skip to content

Instantly share code, notes, and snippets.

View micahbrich's full-sized avatar

Micah Rich micahbrich

View GitHub Profile
#!/usr/bin/env ruby
require 'net/http'
require 'net/https'
user = `git config --global github.user`.strip
token = `git config --global github.token`.strip
raise "Error reading github auth" if user.empty? || token.empty?
auth = {:login => user, :token => token}
@kourge
kourge / gist:820296
Created February 10, 2011 10:47
MacFUSE fs in MacRuby, with custom volume icon
framework 'cocoa'
class HelloFS
PATH = '/hello.txt'
def contentsOfDirectoryAtPath(path, error: error)
[PATH.lastPathComponent]
end
def contentsAtPath(path)
@mattetti
mattetti / fsevents.rb
Created March 18, 2011 07:19
FSEvents API implementation in MacRuby
if RUBY_ENGINE == 'macruby'
framework 'CoreServices'
WATCHED_EXTS = "rb,builder,erb,nokogiri"
PASSENGER_RESTART_FILE = File.expand_path(File.join(File.dirname(__FILE__), "..", "tmp", "restart.txt"))
DELAY = 3
def modified_files(path)
Dir.glob("#{File.expand_path(path)}/*.{#{WATCHED_EXTS}}").map do |filename|
begin
@aaronbrethorst
aaronbrethorst / t2p.rb
Created May 16, 2011 02:32
Twitter Timeline to Cocoa plist
require 'rubygems'
require 'json'
require 'plist'
require 'open-uri'
File.open("/Users/aaron/Desktop/tweets.plist", 'w') {|f| JSON.parse(open("http://api.twitter.com/1/statuses/user_timeline.json?screen_name=cocoacontrols").read).to_plist}
@oisin
oisin / gist:987247
Created May 23, 2011 18:34 — forked from leereilly/gist:987094
API version checking using Sinatra's before filter; supports nested resources
require 'sinatra'
# Set the version of the API being run here
#
MAJOR_VERSION = 1
MINOR_VERSION = 0
VERSION_REGEX = %r{/api/v(\d)\.(\d)}
helpers do
def version_compatible?(nums)
@cdcarter
cdcarter / form_helper.rb
Created June 4, 2011 02:52
NS Form Helper Class
class FormHelper
attr_accessor :form
def initialize(nsform=nil)
@form = nsform
end
def length
form.numberOfRows
end
@paulnicholson
paulnicholson / powssl
Last active November 24, 2021 16:40
ssl with pow using stud

Instructions

  • Install stud $ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
  • Download and install the powssl script $ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl $ chmod +x ~/bin/powssl
  • Run powssl to create development certificate and configure stud.
  • $ powssl
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@davelab6
davelab6 / INSTALL-ttfautohint.md
Last active July 26, 2017 05:33
How to install TTFAutohint 0.92

With HomeBrew

If you have Homebrew and are comfortable with it, you can run

brew edit ttfautohint;

and then replace the file with this one

require 'formula'
@kamiller
kamiller / belkin_n300_router_tomato_setup.md
Created February 21, 2013 23:44
Belkin n300 share router tomato USB flash instructions

TomatoUSB Setup Guide

So, about those instructions. An important thing to know is that the model number of this router is F7D7302, which is just a newer version of the F7D3302. So when you're searching for firmware that's the model you want to use. Now, I've spent some time doing research to get this working with TomatoUSB and finally came with a pretty simple solution. I've noticed a lot of guides want you to install DD-WRT first, which is completely unnecessary.

The best version for this unit right now is the TomatoUSB builds from Toastman. While this may appear to be a lot of steps, it's really not all that complicated.

You're going to want two files for this procedure. Google "tomato toastman 4shared" to find the repository (it's hosted on a download site called 4shared). You'll be looking for the latest version in the RT (MIPSR2) folder (each version will be split into VLAN and STD versions, you'll want the STD one). Inside of that folder will be a bunch of .bin and .trx files. You'll want the .