Skip to content

Instantly share code, notes, and snippets.

View kastner's full-sized avatar
🕳️
actively choosing...

Erik Kastner kastner

🕳️
actively choosing...
View GitHub Profile
@kastner
kastner / gist:545
Created July 22, 2008 01:00 — forked from anonymous/gist:543
Joe's meta-programing for testing private stuff in PHP
<?php
class Foo
{
protected $user = null;
public function __construct($user)
{
$this->user = $user;
}
# run in a directory with ustream-offline.gif and ustream-live.gif
# this makes a symbolic link to the current status as just "ustream.gif"
ln -nfs ustream-`curl -s "http://api.ustream.tv/json/channel/wine-library-tv/getValueOf/status?key=$API_KEY&callback=s" | sed -e 's/s(\"\(.*\)\");/\1/g'`.gif ustream.gif
require 'rubygems'
require 'hpricot'
require 'open-uri'
require 'aws/s3'
include AWS::S3
BUCKET = 'your-bucket-name'
AWS::S3::Base.establish_connection!(
:access_key_id => 'your-amazon-access-id',
require 'net/http'
require 'uri'
class ScreenShooter
SCREEN_SHOOTER_URL = 'http://www.browsrcamp.com/'
class << self
def screenshot_for(url)
returning new(url) do |shooter|
shooter.shoot
end

This is an email I sent out on 8/29/06 to a few people to let them know what I thought was going on with online video.


I was so excited driving home about this message that I couldn't wait to get inside to write it -- I'm sitting in my car right now! Two warnings before I start:

  1. I am VERY passionate about user created video, so this email will be a bit excited
  2. To that end, I'm going to provide a simple Summary at the bottom if
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
#!/usr/bin/php
<?php
define("BASE32", "0123456789bcdefghjkmnpqrstuvwxyz");
function geo_hash_decode($geo_hash) {
$ones_and_zeros = array_map("chr2bin", str_split($geo_hash, 1));
$exploded = str_split(join($ones_and_zeros, ""), 1);
$l_l = array(0 => array(), 1 => array());
require 'syslog'
def log(message)
# $0 is the current script name
Syslog.open($0, Syslog::LOG_PID | Syslog::LOG_CONS) { |s| s.warning message }
end
#!/usr/bin/env ruby
def lines
@input ||= STDIN.read
lines = 0
@input.each_line do |line|
line.split(/\|/).each_with_index do |c, i|
yield lines, c, i
end
lines += 1
end
function _parseHTML(html) {
var doc = context.focusedWindow.document;
var div = doc.createElement( "div" );
div.innerHTML = html;
return div;
}
CmdUtils.CreateCommand({
name:"toggle-these",
homepage: "http://metaatem.net/",