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
<?php | |
class Controller_Twitter extends Controller { | |
public function action_index () { | |
// Load a consumer from config file. | |
$consumer = OAuth_Consumer::factory( Kohana::config( 'oauth.twitter' ) ); |
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 | |
unlink screen.mpg | |
unlink camera.mpg | |
echo "Starting Desktop Grab" | |
ffmpeg -f x11grab -s `xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -r 25 -i :0.0 -sameq screen.mpg > /dev/null 2>&1 & | |
echo "Starting Camera Grab" | |
ffmpeg -f video4linux2 -s 640x480 -i /dev/video0 -sameq camera.mpg > /dev/null 2>&1 & | |
read -p "Press any key to stop recording." | |
ps aux | grep ffmpeg | awk '{print $2}' | xargs kill |
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
<?php | |
/* | |
Given a path, this function will enumerate the files on that path. | |
This tree: | |
test | |
├── 1.txt | |
├── a |
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/env python | |
import unittest | |
from itertools import cycle | |
## get a list in chunks | |
## if we run out of items in the list, start again from the beginning | |
class Chunker(object): |
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
<html> | |
<head> | |
</head> | |
<body> | |
<canvas id="base" width="500" height="500" style="border: 1px solid #444; background: #000;"></canvas> | |
<script> | |
var elem = document.getElementById( 'base' ); | |
var context = elem.getContext( '2d' ); | |
var Sprite = function () { |
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 | |
# | |
# This script will install and configure a PPTPD server on your Ubuntu box. | |
# I use this for a micro instance on Amazon EC2 as a quick, cheap (free!) VPN | |
# | |
# This script was tested with Natty Narwahl 11.04, ami-06ad526f | |
# | |
# Usage: | |
# wget https://gist.github.com/raw/950539/pptpd.sh |
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/env python | |
# Origin: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ | |
# Cooked up a bit by @jmhobbs | |
import sys, os, time, errno, atexit | |
from signal import SIGTERM | |
class Daemon: | |
""" |
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
# -*- coding: utf-8 -*- | |
# Copyright (c) 2010 John Hobbs | |
# | |
# http://github.com/jmhobbs/googlecode-irc-bot | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
# -*- coding: utf-8 -*- | |
# Copyright (c) 2010 John Hobbs | |
# | |
# http://github.com/jmhobbs/googlecode-irc-bot | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
require 'formula' | |
class NodeUnstable <Formula | |
url 'http://nodejs.org/dist/node-v0.3.8.tar.gz' | |
head 'git://github.com/ry/node.git' | |
homepage 'http://nodejs.org/' | |
md5 '9ed9b4ec2fd726d6e9c94eb3f7b82090' | |
# Stripping breaks dynamic loading | |
skip_clean :all |