Skip to content

Instantly share code, notes, and snippets.

@phwd
phwd / gist:671389
Created November 10, 2010 19:46
Makefile for meepmeep.cpp
meepmeep: meepmeep.cpp Makefile
$(CXX) -o $@ $<
@phwd
phwd / meepmeep.c
Created November 10, 2010 20:21
meepmeep
#include <stdio.h>
main()
{
printf("Meep meep!\n");
}
@phwd
phwd / hoppity.cpp
Created April 29, 2011 00:17
hoppity
#include <iostream>
using namespace std;
int main (int argc,char *argv[]) {
int line;
FILE * myfile;
if (argc ==1)
{
return 0;
@phwd
phwd / wakeup.scpt
Created October 26, 2011 00:44
Wakeup in the morning
property tick : 2 -- raise volume level by this many each loop
property thismany : 1 -- seconds to wait before making next increment to volume
tell application "iTunes"
set snd to sound volume
set sound volume to 0
play playlist "wakeup" -- your playlist here
repeat
if (get sound volume) is greater than or equal to (snd - tick) then
set sound volume to snd
exit repeat
@phwd
phwd / gist:2570968
Created May 1, 2012 20:04
FQL stream call for posts past a certain date
SELECT post_id FROM stream WHERE filter_key ='nf' and created_time < 1335500000
@phwd
phwd / gist:2575760
Created May 2, 2012 10:27
Turn the t stream into Growl notifications
t stream timeline | while read u; do read s; read b; growlnotify -t "$u" -m "$s"; done
# Beware the following will fill your screen
t stream search "#IWishYouKnew" | while read u; do read s; read b; growlnotify -t "$s" -m "$b"; done
@phwd
phwd / gist:2690706
Created May 13, 2012 23:07
Facebook comments skeleton
<!DOCTYPE html>
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<meta charset="utf-8">
<title>Comments Plugin</title>
<meta name="description" content="Example of Facebook Comments"</title>
<meta property="fb:app_id" content="YOUR_APP_ID">
<meta property="og:url" content="YOUR_URL">
<meta property="og:title" content="Comments Plugin">
<meta property="og:description" content="Example of Facebook Comments">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title>Junkaholic &mdash; Home</title>
<meta charset="utf-8">
<meta property="fb:app_id" content="270173419678397">
<meta property="og:url" content="http://junkaholic.co.uk">
<meta property="og:title" content="Junkaholic &mdash; Home">
@phwd
phwd / gist:2815785
Created May 27, 2012 20:28
FQL query for movies friends like
SELECT name, page_id from page where page_id in (SELECT page_id from page_fan where uid in (SELECT uid2 FROM friend WHERE uid1 = me()) and profile_section='movies')
<?php
require '../src/facebook.php';
// Create our Application instance (replace this with your appId and secret).
$facebook = new Facebook(array(
'appId' => 'app_id',
'secret' => 'your_secret',
));