Skip to content

Instantly share code, notes, and snippets.

View loisaidasam's full-sized avatar
🙌
🙌

Loisaida Sam loisaidasam

🙌
🙌
View GitHub Profile
@loisaidasam
loisaidasam / F21S_arrivals_sorted.json
Created August 26, 2015 15:41
Sorted F21S (Carroll St.) Arrival Times, via http://mtaapi.herokuapp.com/api?id=F21S
{
"arrivals": [
"00:35:00",
"00:35:00",
"00:38:00",
"00:55:00",
"00:55:00",
"00:58:00",
"01:05:00",
"01:05:00",
@loisaidasam
loisaidasam / android-scraper.py
Created February 13, 2014 23:39
Android Scraper - get info about an app in the Google Play Store
import argparse
import sys
from bs4 import BeautifulSoup
import requests
def main():
parser = argparse.ArgumentParser(description="Get info about an app in the Google Play Store")
@loisaidasam
loisaidasam / 0002_indexes.py
Created February 19, 2014 19:13
A template for adding indexes via a South migration
# -*- coding: utf-8 -*-
import copy
from south.db import db
from south.v2 import SchemaMigration
###
# CHANGE THESE VALUES TO FIT YOUR PROJECT
INDEXES = (
@loisaidasam
loisaidasam / multiplayer_2048_with_fwilson.md
Created May 1, 2014 19:51
fwilson plays multiplayer #2048

http://f.cl.ly/items/032V110d201O3m0G2Q2Q/Screen%20Shot%202014-05-01%20at%203.34.41%20PM.png

[15:12:28]   fwilson (fwilson@wikipedia/Fox-Wilson) joined the channel.
[15:12:32]  <fwilson>    woah
[15:12:34]  <fwilson>    this exists
[15:12:36]  <fwilson>    dat2048bot: help
[15:12:38]  <fwilson>    !help
[15:12:40]  <fwilson>    .help
[15:12:42]  <fwilson>    :|

[15:33:25] hehe

@loisaidasam
loisaidasam / index.php
Created June 11, 2014 15:35
NYC Weather - just throw this in a web folder somewhere
<?php
header('Content-type: image/gif');
echo file_get_contents('http://sirocco.accuweather.com/nx_mosaic_640x480_public/sir/inmasirmr_nyc.gif');
@loisaidasam
loisaidasam / curl_response_code
Created June 11, 2014 16:35
curl, simply returning response code
#!/bin/bash
curl -sL -w "%{http_code} %{url_effective}\\n" -o /dev/null "$@"
@loisaidasam
loisaidasam / hubot_slack_test.sh
Last active August 29, 2015 14:02
A script for testing your Hubot's Slack webhook
#!/bin/bash
HEROKU_URL="$1"
if [ -z "$HEROKU_URL" ] ; then
HEROKU_URL=`heroku config:get HEROKU_URL`
fi
SLACK_URI="$HEROKU_URL/hubot/slack-webhook"
CODE=`curl -sL -w "%{http_code}" -o /dev/null -d "" "$SLACK_URI"`
echo "POST to $SLACK_URI code $CODE" >&2
@loisaidasam
loisaidasam / median.py
Created July 31, 2014 15:57
Because there's no readily-available median() function in python?
def median(data):
if not data:
return
length = len(data)
sorts = sorted(data)
if length % 2:
return sorts[length/2]
return 1.0 * (sorts[length/2-1] + sorts[length/2]) / 2
@loisaidasam
loisaidasam / kill_dem_ghosts.sh
Created September 9, 2014 19:41
Kill mysterious ghost celery workers...
ps aux |grep [c]elery | awk '{ print $2 }' | xargs kill -9
@loisaidasam
loisaidasam / curl_a_zip_archive.txt
Last active August 29, 2015 14:06
curl a zip archive (thanks Ben G)
curl -u '<git username>' -L -o master.zip https://github.com/<organization>/<reponame>/zipball/master