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
@abraham
abraham / followers.php
Created September 26, 2010 21:53
Quick script to get all of the followers for Twitter users.
<?php
// Require the TwitterOAuth library. http://github.com/abraham/twitteroauth
require_once('twitteroauth/twitteroauth.php');
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_SECRET);
// Empty array that will be used to store followers.
$profiles = array();
// Get the ids of all followers.
$ids = $connection->get('followers/ids');
// Chunk the ids in to arrays of 100.
@abraham
abraham / grid.css
Created September 30, 2010 06:47
Basic HTML5 template with jQuery and a simple grid
/* Source: http://www.webdesignerwall.com/tutorials/the-simpler-css-grid/ */
.container {
width: 978px;
margin: 0 auto;
}
.grid1, .grid2, .grid3, .grid4, .grid5, .grid6, .grid7, .grid8, .grid9, .grid10, .grid11 {
float: left;
margin-left: 30px;
}
.grid1 {
@abraham
abraham / find.html
Created October 10, 2010 03:26
Add social media share links to your Blogger blog
<!-- Place share links here -->
<div class='post-header'>
{
"history": [{
"short_url": "http://goo.gl/Sp8J",
"long_url": "http://app.apigee.com/console/apigee-console-snapshots-1285909200000_2ec49d92-fb23-4352-8ff2-3a7124df31dc/rendersnapshotview",
"creation_time": "2010-10-10T06:54:16.701+00:00",
"details": {
"two hours": {
"clicks": {
"short_url": 0,
"chart_url": "http://chart.apis.google.com/chart?cht\u003dlfi\u0026chd\u003ds:AAAAAAAAAAAAAAAAAAAAAAAA\u0026chds\u003d0.0,4.9E-324\u0026chs\u003d50x15\u0026chco\u003d287ff5"
@abraham
abraham / gather.xml
Created October 22, 2010 22:29
Building phone menus with Twilio
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather action="/process.php" method="GET">
<Say>Please enter your account number, followed by the pound sign</Say>
</Gather>
<Say>We didn't receive any input. Goodbye!</Say>
</Response>
@abraham
abraham / avatar.php
Created November 20, 2010 09:50
Never have a broken Twitter avatar again
<?php
// Requires the TwitterOAuth library. http://github.com/abraham/twitteroauth
require_once('twitteroauth/twitteroauth.php');
// ACCESS_TOKEN and ACCESS_SECRET are only needed if you want the request to count against a specific users rate limit.
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_SECRET);
if(!empty($_REQUEST['screen_name']) {
// I'm using users/show but you could also use users/profile_image here.
$connection->get('users/show', array('screen_name' => $_REQUEST['screen_name']));
if($connection->http_code == 200) {
@abraham
abraham / body.html
Created January 10, 2011 01:31
GitHub Anywhere example code
<!-- Place anywhere in the <body> of your page replacing :name with a GitHub username and :repo with a repository name -->
<a href='http://github.com/:name' class='github-anywhere github-anywhere-user' data-user=':name'>Follow :name on GitHub</a>
<a href='http://github.com/:name/:repo' class='github-anywhere github-anywhere-watch' data-user=':name' data-repo=':repo'>Watch :name/:repo on GitHub</a>
// ==UserScript==
// @match http://*/*
// @match http://*.google.com/*
// @match http://www.google.com/*
// ==/UserScript==
console.log('test');
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>HTML5 boilerplate—all you really need…</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<!--[if IE]>
<!--<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>-->T
<![endif]-->
</head>
GET http://intersect.api.abrah.am/v1/intersect.json?screen_name=abraham,therealcaro
{
"common_friends": [ ],
"common_followers": [ ],
"abraham_friends_following_therealcaro": [ ],
"therealcaro_friends_following_abraham": [{
"follow_request_sent": false,
"following": false,
"friends_count": 22,