Skip to content

Instantly share code, notes, and snippets.

View andypiper's full-sized avatar
🛠️
tinkering

Andy Piper andypiper

🛠️
tinkering
View GitHub Profile
@hiway
hiway / auth.py
Last active July 20, 2023 15:56
A bare-minimum implementation of Twitter's Streaming API using python-requests library. Prints out tweets as they come in.
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''
#!/usr/bin/env ruby
require 'pp'
require 'date'
content = STDIN.read()
REGEX = %r{
(?:
require 'rss'
require 'pp'
require 'rss/dublincore'
$totals = Hash.new(0)
$authors = Hash.new(0)
FORUM_ID = 221 # replace this with your frm_id
def calculate(feed)
@danhigham
danhigham / gist:4654412
Created January 28, 2013 10:15
Sample manifest.yml for node app with env variable
---
applications:
- name: nodetestdh01
framework: node
runtime: node08
memory: 64M
instances: 1
url: nodetestdh01.${target-base}
path: .
env:
@danhigham
danhigham / Markdown-Terminal.sublime-snippet
Created January 29, 2013 12:13
Sublime snippet to create terminal blocks in markdown
<snippet>
<content><![CDATA[
<pre class="terminal">
$1
</pre>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>term</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.markdown</scope> -->
@danhigham
danhigham / Gemfile
Last active October 27, 2018 15:44
Simple ruby script to download the contents of an application running on Cloud Foundry to a zip file
source :rubygems
gem 'cfoundry'
gem 'uuidtools'
anonymous
anonymous / mqttjogglermashup.c
Created February 11, 2013 09:16
Simply publishes the Joggler light level reading to MQTT.
/*
* Basic mash up of Andrew de Quincey's Joggler light sensor code
* and sample MQTT client code to publish light sensor reading
* messages.
* For more info. see:
* http://code.google.com/p/adqmisc/source/browse/trunk/joggler/readlightsensor.c
* http://www.eclipse.org/paho/files/mqttdoc/Cclient/
* http://jtlog.wordpress.com/2013/02/07/mqtt-joggler/
*/
#include "stdio.h"
@andysc
andysc / cpu.pl
Last active April 6, 2022 03:03
Blink(1) CPU monitor for linux. A little perl app which uses vmstat to see how busy the CPU is, and turn the Blink(1) blue through magenta through red, accordingly, using the command-line blink1-tool
# cpu.pl
# Andy Stanford-Clark
# Feb-13
# seconds between readings from vmstat
$sample_interval = 30;
# drive a blink(1) to represent the CPU usage
# blue is low, red is high
@hardillb
hardillb / httprc
Created March 6, 2013 16:09
Quick script to look up http status codes on their wikipedia page ./httprc 200
#!/bin/sh
links http://en.wikipedia.org/wiki/HTTP_code#$1
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'