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;
}
input = "[{id: 'lookingAtFoo0', inResponseTo: 'looking at foo', onFinish: 'delete foo'}, {name: 'looking at foo', inResponseTo: 'found foo', onFinish: 'clikced foo'}]"
nodes = {}
class Node
def initialize(thisId)
self.id = thisId
end
gem 'activerecord', '4.0'
gem 'sqlite3'
# 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',

Copy and paste the swift code below into a playground to experiment.

This is a very close emulation of Functor and Monad typeclasses in swift. However, it is very fragile (i.e. easy to crash the compiler).

For example, instance methods of fmap will run fine, but attempting to use a globally defined fmap that acts on Functor types will cause a crash. Similarly for bind. Unfortunately this means we cannot define the nice infix operator versions of these functions.

#
# ElasticSearch Dockerfile
#
# https://github.com/dockerfile/elasticsearch
#
# Pull base image.
FROM dockerfile/java
# Install ElasticSearch.
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 {