Moved to https://github.com/ucnv/diff-for-gist.github. This script is also available at .
require 'net/http' | |
require 'uri' | |
# /api/v1/:format/new | |
# /api/v1/:format/gists/:user | |
# /api/v1/:format/:gist_id | |
res = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'), | |
{ 'files[file1.ab]' => 'CONTNETS', | |
'files[file2.ab]' => 'contents' }) |
# add in your .bashrc | |
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# http://blog.cyberion.net/2009/01/improved-bash-prompt-for-git-usage.html | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master⚡]$ # dirty working directory | |
# | |
# I've made the following ajustements: | |
# - Use of plumbing, that should be faster than git status porcelain. | |
# - Don't show my repo as dirty if it has files unknown from the index (I always have). |
if (typeof String.prototype.supplant !== 'function') { | |
String.prototype.supplant = function (o) { | |
return this.replace(/{([^{}]*)}/g, | |
function (a, b) { | |
var r = o[b]; | |
return typeof r === 'string' ? r : a; | |
}); | |
}; | |
} |
// github gist linker | |
// Copyright (c) 2009, Chris Moyer (chris@inarow.net) http://inarow.net/ | |
// MIT (http://www.opensource.org/licenses/mit-license.php) licensed. | |
// | |
// | |
// ==UserScript== | |
// @name github gist linker | |
// @namespace http://inarow.net/ | |
// @include http://github.com/* | |
// @description Version 0.5 |
// ==UserScript== | |
// @name Gist UserScript Install Link | |
// @author Erik Vold | |
// @namespace gistUserScriptInstallLink | |
// @include http://gist.github.com/* | |
// @version 0.1 | |
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html | |
// @datecreated 2010-01-28 | |
// @lastupdated 2010-01-28 | |
// @description This userscript will add an 'Install' link to all userscript files (which end with .user.js by necessity). |
#!/bin/bash | |
touch input.txt | |
touch output.txt | |
echo -n "Enter Command: " | |
read INCOM | |
echo "$INCOM" > input.txt | |
while [ -f input.txt ];do |
// Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
// use this file except in compliance with the License. You may obtain a copy of | |
// the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
// License for the specific language governing permissions and limitations under |
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.
- Redirect to this link to request GitHub access:
Using CouchDB with node.js
First, get yourself a CouchDB! You can get a free hosted CouchDB in seconds or download a binary from the Couchio downloads page.
Next, install npm because all awesome node packages are in npm :)
Node has better support for HTTP than any language I've ever worked with and coincidentally CouchDB's interface is solely accessible via HTTP. First, let's just talk to CouchDB using an HTTP library and later we'll look at some higher level abstractions.