Skip to content

Instantly share code, notes, and snippets.

View technoweenie's full-sized avatar
👾
beep boop

technoweenie

👾
beep boop
View GitHub Profile
@technoweenie
technoweenie / gist:1072829
Created July 8, 2011 21:12
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@technoweenie
technoweenie / github_oauth_busy_developer_guide.md
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@technoweenie
technoweenie / minimal-logger.coffee
Created March 9, 2011 20:25
Minimal node.js logger
# logger = require('logger').create()
# logger.info("blah")
# => [2011-3-3T20:24:4.810 info (5021)] blah
# logger.debug("boom")
# =>
# logger.level = Logger.levels.debug
# logger.debug(function() { return "booom" })
# => [2011-3-3T20:24:4.810 error (5021)] booom
class Logger
constructor: (options) ->
@technoweenie
technoweenie / parslet_test.rb
Created January 12, 2011 12:11
quick JSON example parser using parslet
require 'rubygems'
require 'parslet'
require 'pp'
def parse(klass, str)
parser = klass.new
puts "parsing #{str}"
pp parser.parse(str)
puts
rescue Parslet::ParseFailed => err
@technoweenie
technoweenie / keybase.md
Created January 6, 2019 18:35
keybase proof

Keybase proof

I hereby claim:

  • I am technoweenie on github.
  • I am technoweenie (https://keybase.io/technoweenie) on keybase.
  • I have a public key ASDYg1Rh0rCIQPFh7-m5Ip0vINt46_GxKKcpHCF6WN_-Uwo

To claim this, I am signing this object:

package main
import (
"fmt"
"github.com/moovweb/gokogiri"
"io/ioutil"
"net/http"
"net/url"
"time"
)
@technoweenie
technoweenie / pinger.rb
Created June 17, 2011 14:38
ZeroMQ pub/sub demo
require 'zmq'
context = ZMQ::Context.new
pub = context.socket ZMQ::PUB
pub.setsockopt ZMQ::IDENTITY, 'ping-pinger'
pub.bind 'tcp://*:5555'
i=0
loop do
pub.send "ping pinger #{i+=1}" ; sleep 1
end
package main
import (
"fmt"
"sync"
)
func main() {
fmt.Println("WAT")
}
@technoweenie
technoweenie / gist:5101109
Last active January 7, 2016 16:56
API Existential Crisis

API Existential Crisis

One bit of feedback we've heard from some heavy users of the API is that they want to access user and repository data by ID, and not name.

GET /users/technoweenie
GET /repos/technoweenie/faraday

If you're tracking user or repository data, using a URL with a unique and unchanging ID means the application won't break if the user or repository is

package main
import (
"fmt"
"github.com/Merovius/git2go"
"os"
)
// $ GOPATH=./vendor go run test.go
// # command-line-arguments