Skip to content

Instantly share code, notes, and snippets.

View loisaidasam's full-sized avatar
🙌
🙌

Loisaida Sam loisaidasam

🙌
🙌
View GitHub Profile
@loisaidasam
loisaidasam / espn-headlines.sh
Last active November 10, 2017 19:28
ESPN Headlines
#!/bin/bash
# https://gist.github.com/loisaidasam/e4e475f47c47d18ad39d
# Requires `pup` and `jq` in your `$HOME/bin` dir
# TODO: Figure out how to do this
#BOT_NAME="ESPN Headlines Bot"
#VERSION="0.3"
#USER_AGENT="$BOT_NAME/$VERSION"
@loisaidasam
loisaidasam / README.md
Last active August 3, 2025 13:13
Sort git tags by semver

If you're like me and you use semver for versioning your tags, you probably hate when you do this:

$ git tag -l
0.1.0
0.10.0
0.2.0
0.3.0
0.3.1
0.4.0

0.5.0

@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 / carnac.py
Last active August 29, 2015 14:21
A brute-force solution to Carnac the Magnificent
"""Carnac the Magnificent!
http://raganwald.com/2015/05/08/carnac-the-magnificent.html
https://news.ycombinator.com/item?id=9511700
"""
import itertools
import sys
@loisaidasam
loisaidasam / injuries_unique.sh
Last active August 29, 2015 14:19
Sort NBA injury data for counts of unique injuries
#!/bin/bash
# Based on https://gist.github.com/loisaidasam/0431f4d1b8a3c120b978
./injuries.sh | jq '.[].injury' | sort | uniq -c | sort -nr
@loisaidasam
loisaidasam / injuries.sh
Last active August 29, 2015 14:19
Actionable NBA injuries data from Rotoworld
#!/bin/bash
curl -Ss http://www.rotoworld.com/teams/injuries/nba/all/ | \
pup 'div#cp1_pnlInjuries tr json{}' | \
jq '[.[] | {name: .children[0].children[0].text, pos: .children[2].text, status: .children[3].text, date: .children[4].text, injury: .children[5].text, returns: .children[6].text} | select(.date != null)]'
@loisaidasam
loisaidasam / postactivate
Created April 17, 2015 16:07
Pull your Heroku-specific settings locally on virtualenv activation
#!/bin/bash
# This hook is run after this virtualenv is activated.
# This part requires `heroku-config`
# (install like this: heroku plugins:install git://github.com/ddollar/heroku-config.git)
echo "Pulling all heroku environment variables..."
heroku config:pull --overwrite --quiet
set -a
source .env
@loisaidasam
loisaidasam / README.md
Last active April 5, 2023 18:37
The Masters API!
@loisaidasam
loisaidasam / problem.md
Created April 6, 2015 18:29
Deserted Island Seesaw Problem

There are 12 people on a deserted island. 11 of them each have the same weight and 1 of them weighs either more or less than the others. Your task is to figure out if that person weighs more or less than any of the others.

There are no scales on the island, but there is a seesaw (that fits as many people on it at once as you like). The limitation is that you can only use the seesaw 3 times in total.

How do you use the seesaw to figure out if the person weighs more or less?

@loisaidasam
loisaidasam / README.md
Last active August 29, 2015 14:18
All golfers and their rankings