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 / update_profile_background_image.rb
Created January 21, 2010 04:11 — forked from r/update_profile_background_image.rb
Ruby example of uploading images through OAuth
#!/usr/bin/env ruby
# update_profile_background_image.rb
#
# a simple example of how to construct the OAuth signatures necessary to upload
# a background image to a Twitter profile page. this will call
# account/update_profile_background_image.xml with the contents of
# 'background.png' (must be in the same directory as this script). care has
# been given to document this script, as well as to correlate lines in this
# script with the OAuth Core 1.0 specification (http://oauth.net/core/1.0/).
@abraham
abraham / error.php
Created March 10, 2010 23:42
Display PHP error notices
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);
CREATE TABLE `user` (
`twitter_id` int(10) unsigned NOT NULL,
`name` varchar(140) NOT NULL,
`screen_name` varchar(30) NOT NULL,
`location` varchar(180) default NULL,
`description` varchar(300) default NULL,
`profile_image_url` varchar(400) NOT NULL,
`url` varchar(400) default NULL,
`protected` varchar(5) default NULL,
`followers_count` int(10) unsigned NOT NULL,
function iev(count)
{
var ifs=$('iframe',g.getActiveViewElement());
var ifm;
for(var i=0;i
{
if(!ifs[i].gcc_added)
{
ifm=ifs[i].contentDocument;
ifm.body.setAttribute('count_class','char_count'+count);
#!/usr/bin/perl
# updated 2008-08-21
$baseurl = 'http://ftp.drupal.org/files/projects/';
$fileextension = '.tar.gz';
$core = 'drupal-6.4';
$modulesfolder = 'sites/all/modules/';
$themesfoler = 'sites/all/themes/';
$settingsfolder = 'sites/default/';
from google.appengine.ext import webapp
from google.appengine.ext import users
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp.util import login_required
class MainPage(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
require 'rubygems'
require 'yajl/http_stream'
require 'uri'
require 'open-uri'
USERNAME = 'username'
PASSWORD = 'password'
# If you've got a ton of either, you'll have to fork and cursor through
fr_ids = Yajl::HttpStream.get(URI.parse("https://api.twitter.com/1/friends/ids/#{USERNAME}.json"))
@abraham
abraham / annotations.php
Created May 29, 2010 20:21
Simple PHP example of adding annotations to tweets using TwitterOAuth
<?php
/**
* Note: Only select accounts have annotations enabled.
*
* If you have questions or comments please let me know. - @abraham
*
* Read about annotations:
* https://apiwiki.twitter.com/Annotations-Overview
*
* Get the TwitterOAuth source code:
@abraham
abraham / chat.txt
Created June 28, 2010 22:47
Funny https://t.imo.im exchange with spammer @julian080
@julian: @abraham I would like to start a chat with you on https://t.imo.im/?u=julian080
----------
me : hello?
julian080: hi
julian080: asl pls
julian080: yuo there?
me : asl? why did you @reply me on twitter?
julian080: k
julian080: My name is garvins julian
julian080: frm nig
@abraham
abraham / blog.abrah.am
Created June 29, 2010 04:21
Custom <head> code for http://blog.abrah.am
<!-- Custom -->
<link href='http://a3.twimg.com/profile_images/54160223/chart-black-small_mini.png' rel='icon' type='image/png'/>
<meta content='Young idealistic thoughts on #twitter, #google, #drupal, and #minimalism.' name='description'/>
<!-- Twitter Anywhere -->
<script src='http://platform.twitter.com/anywhere.js?id=412DNHegCUTUSZ67NnrQ&amp;v=1'>
</script>
<script type='text/javascript'>