This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while : | |
do | |
OUTPUT="$(./print_active_app.py)" | |
echo "application=$OUTPUT" | nc localhost 8081 | |
sleep 0.1 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from AppKit import NSWorkspace | |
print NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /var/log | |
find ./ -type f -name \*.*.1 -exec rm {} \; -o -name \*.gz |