Skip to content

Instantly share code, notes, and snippets.

View saadullahsaeed's full-sized avatar

Saadullah Saeed saadullahsaeed

  • Bundle
  • San Francisco, CA
View GitHub Profile
@saadullahsaeed
saadullahsaeed / manifest.json
Created January 2, 2012 23:26
Chrome extension to list newest kiva loans
{
"name": "Kiva Newest Loans - Saad",
"version": "0.1",
"description": "A small handy extension to view the latest loans on Kiva.",
"browser_action": {
"default_icon": "icon.png",
"popup" : "popup.html"
},
"permissions": [
"http://api.kivaws.org/"
@saadullahsaeed
saadullahsaeed / multiThreadedCURL.php
Created January 17, 2012 19:39
PHP function to do parallel curl requests
function threadedRequests($urls){
$mh = curl_multi_init();
$curl_array = array();
foreach($urls as $i => $url){
$curl_array[$i] = curl_init($url);
curl_setopt($curl_array[$i], CURLOPT_RETURNTRANSFER, true);
curl_multi_add_handle($mh, $curl_array[$i]);
@saadullahsaeed
saadullahsaeed / pandoraToMog.js
Created April 3, 2012 05:51
Bookmarklet to open current Pandora Song in Mog
javascript:function pToMog(){
var song = document.getElementsByClassName('songTitle')[0].text;
var artist = document.getElementsByClassName('artistSummary')[0].text;
window.open('https://mog.com/m#search/'+artist+' '+song);/*Pandora to Mog by Saad*/
};
pToMog();
void(0);
@saadullahsaeed
saadullahsaeed / safeway_coupon_add.js
Created May 21, 2012 03:15
Bookmarklet to Auto-Add all offers / coupons on Safeway site. Just drag it to Bookmark bar.
javascript:var els = Ext.select('a[class=lt-add-offer-link]').elements;for(var i in els){els[i].click()}
@saadullahsaeed
saadullahsaeed / ruby-graphite.rb
Created June 4, 2012 19:53
Ruby: Send metric to carbon
require 'socket'
host = '127.0.0.1'
port = 2003
socket = TCPSocket::new(host, port)
socket.puts("system.loadavg_1min 2.0 #{Time.now.to_i}\n")
@saadullahsaeed
saadullahsaeed / redis-setbit-test.coffee
Created August 13, 2012 17:43
Testing 'setbit' and 'bitcount' on Redis 2.6
express = require 'express'
redis = require 'redis'
app = express()
requestCount = 0
client = null
#Going to use Date as the Key
getKey= ->
d = new Date()