Skip to content

Instantly share code, notes, and snippets.

View abraham's full-sized avatar
thanks a latte

Abraham Williams abraham

thanks a latte
View GitHub Profile
<html>
<head>
<title>Google XAuth Demo</title>
<script type="text/javascript" src="http://xauth.org/xauth.js"></script>
<script type="text/javascript">
function doLogin(doneUrl) {
/* Tell XAuth.org that a user has just signed into Google on this browser. */
XAuth.extend({
// Just reveals "someone is logged into Google" but no personally identifiable info.
@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:
<?php
include ("oAuth.php");
$noisy_debug_mode = 1;
define("twitpicApiKey", "twitPic_Api_key");
define("consumerSecret", 'myConsumerSecret');
define("consumerKey", "myConsumerKey");
define("oauthToken", "myAccessToken");
define("oauthTokenSecret", "myAccessTokenSecret");
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
coj@revolverocelot ~ > curl -u myusername http://api.twitter.com/1/account/rate_limit_status.json?source=twitterandroid
Enter host password for user 'myusername':
{"hourly_limit":20000,"reset_time_in_seconds":1284388122,"reset_time":"Mon Sep 13 14:28:42 +0000 2010","remaining_hits":19994}
Mon Sep 13 09:29:07 EDT 2010
coj@revolverocelot ~ > curl -u myusername http://api.twitter.com/1/account/rate_limit_status.json?
Enter host password for user 'myusername':
{"remaining_hits":0,"hourly_limit":0,"reset_time":"Mon Sep 13 14:28:42 +0000 2010","reset_time_in_seconds":1284388122}
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active May 16, 2024 16:51
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
/*-------- Here's how your Gists render in #newtwitter's details pane --------*/
twttr.mediaType('twttr.media.types.Gist')
.url('http://gist.github.com')
.matcher(/\b(?:https?\:\/\/)?gist\.github\.com\/(\S+)/g)
.icon('generic')
<?php
// Define the 'class' class
$class = Obj()
->fn('new', function ($class) {
$newClass = Obj($class->methods)
->fn('new', function($class) {
$obj = Obj($class->imethods);
$args = func_get_args();
array_shift($args);
<?php
/**
* Compares all running instances to all reserved instances and reports
* utilization. Useful for making sure you're not wasting money. :P
*
* Requires EC2_CERT and EC2_PRIVATE_KEY environment variables to be set.
*
* @author Dave
* @date 2010-10-05
*/
@episod
episod / mention.xml
Created October 11, 2010 14:00
a mention and reply
<status>
<created_at>Fri Oct 08 14:43:57 +0000 2010</created_at>
<id>26755568880</id>
<text>@episod&#160;Thinking today's avatar might be crazier than any one before. I thought the sensible one the other day was pretty good :-)</text>
<source>&lt;a href=&quot;http://www.tweetdeck.com&quot; rel=&quot;nofollow&quot;&gt;TweetDeck&lt;/a&gt;</source>
<truncated>false</truncated>
<in_reply_to_status_id></in_reply_to_status_id>
<in_reply_to_user_id>819797</in_reply_to_user_id>
<favorited>false</favorited>
<in_reply_to_screen_name>episod</in_reply_to_screen_name>