Skip to content

Instantly share code, notes, and snippets.

// This is a dead-simple script that simply logs the usernames of the people who have updated a post, ordered by when they voted
var access_token = "YOUR_TOKEN";
var post_id = "POST_ID";
var theUrl = "https://api.producthunt.com/v1/posts/"+post_id+"/votes?access_token=" + access_token
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false );
xmlHttp.send( null );
votes = JSON.parse(xmlHttp.responseText).votes;
#!/bin/bash
while :
do
OUTPUT="$(./print_active_app.py)"
echo "application=$OUTPUT" | nc localhost 8081
sleep 0.1
done
#!/usr/bin/python
from AppKit import NSWorkspace
print NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName']
@ryanbrink
ryanbrink / clean_logs.sh
Created April 3, 2014 13:00
Quick rotated log file cleanup script
#!/bin/bash
cd /var/log
find ./ -type f -name \*.*.1 -exec rm {} \; -o -name \*.gz