Skip to content

Instantly share code, notes, and snippets.

🙌
🙌

Loisaida Sam loisaidasam

View GitHub Profile
View F21S_arrivals_sorted.json
{
"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 / scour.py
Last active Aug 29, 2015
Hack of the day: How to scour craigslist for a 62cm-64cm bicycle
View scour.py
import time
from bs4 import BeautifulSoup
import requests
BASE_URL = "http://newyork.craigslist.org"
URL = "http://newyork.craigslist.org/search/?sort=rel&areaID=3&subAreaID=&query=bicycle&catAbb=sss"
@loisaidasam
loisaidasam / android-scraper.py
Created Feb 13, 2014
Android Scraper - get info about an app in the Google Play Store
View android-scraper.py
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 Feb 19, 2014
A template for adding indexes via a South migration
View 0002_indexes.py
# -*- coding: utf-8 -*-
import copy
from south.db import db
from south.v2 import SchemaMigration
###
# CHANGE THESE VALUES TO FIT YOUR PROJECT
INDEXES = (
View multiplayer_2048_with_fwilson.md

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]  <sammysands>     hehe
@loisaidasam
loisaidasam / index.php
Created Jun 11, 2014
NYC Weather - just throw this in a web folder somewhere
View index.php
<?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 Jun 11, 2014
curl, simply returning response code
View curl_response_code
#!/bin/bash
curl -sL -w "%{http_code} %{url_effective}\\n" -o /dev/null "$@"
@loisaidasam
loisaidasam / hubot_slack_test.sh
Last active Aug 29, 2015
A script for testing your Hubot's Slack webhook
View hubot_slack_test.sh
#!/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 Jul 31, 2014
Because there's no readily-available median() function in python?
View median.py
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 Sep 9, 2014
Kill mysterious ghost celery workers...
View kill_dem_ghosts.sh
ps aux |grep [c]elery | awk '{ print $2 }' | xargs kill -9
You can’t perform that action at this time.