Skip to content

Instantly share code, notes, and snippets.

// What I'm going after: http://img515.yfrog.com/img515/3872/90335114.png
[TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithTopLeft:-1 topRight:-1 bottomRight:-1 bottomLeft:-1]
next:[TTSolidFillStyle styleWithColor:[UIColor lightGrayColor]
next:[TTBoxStyle styleWithMargin:UIEdgeInsetsZero padding:UIEdgeInsetsMake(0, 8, 0, 8)
next:[TTTextStyle styleWithFont:[UIFont boldSystemFontOfSize:15]
color:[UIColor whiteColor]
minimumFontSize:15
shadowColor:nil
shadowOffset:CGSizeZero
textAlignment:UITextAlignmentCenter
Async URLFetch on appengine-jruby
@woodie
woodie / README.rdoc
Created July 22, 2010 17:02
Rails 2.3.8 on App Engine with DataMapper

Rails 2.3.8 on App Engine (DataMapper)

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TInyDS version also: gist.github.com/gists/269075

Install the Development Environment

@idoru
idoru / XCode_SwapBetweenSpec.scpt
Created November 17, 2010 05:36
[Not compatible with XCode 4] Ever wanted to switch between Cedar specs and your implementation with a single keystroke? Well, there's a user script for that!
(*
SwapBetweenSpec.scpt
Get into the BDD groove with this Xcode user script which quickly toggles between your implementation (or header)
and its Cedar Spec. Bind it to your favorite shortcut key and enjoy the cycle.
Be sure to add this User Script to Xcode as an Applescript, not a shell script:
1. Paste the contents of the gist into ~/Library/Application Support/Developer/Shared/Xcode/User Scripts/SwapBetweenSpec.scpt
2. When adding to script in the "Edit User Scripts" window of Xcode, choose "Add Script File..." and not "New Shell Script" and then choose the file from (1)
3. Set Input to "No Input"
@pamelafox
pamelafox / Completely Static App
Created January 11, 2011 18:20
For App Engine
application: oliverfoxmurals
version: 1
runtime: python
api_version: 1
handlers:
- url: /
static_files: static/index.html
upload: static/index.html
@pamelafox
pamelafox / googl.py
Created April 29, 2011 21:27
Shortening URLS using goo.gl
import cgi
import urllib, urllib2
import logging
from django.utils import simplejson
class Googl():
def __init__(self, api_key):
self.api_key = api_key
self.base_url = 'https://www.googleapis.com/urlshortener/v1/url?key=%s' % self.api_key
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@mattetti
mattetti / gist:1009624
Created June 6, 2011 01:41
mango routed sample app example
package main
import(
"github.com/paulbellamy/mango"
"fmt"
)
func hello(env mango.Env) (mango.Status, mango.Headers, mango.Body) {
env.Logger().Println("Got a", env.Request().Method, "request for", env.Request().RawURL)
return 200, mango.Headers{}, mango.Body("Hello World!")
@mattetti
mattetti / main.go
Created June 6, 2011 01:48
Go's reflection example
package main
import(
"fmt"
"reflect"
)
func main(){
// iterate through the attributes of a Data Model instance
for name, mtype := range attributes(&Dish{}) {

Currently the RubyGems index is stored as a Gzip file that is a marshalled array. Whenever Bundler needs to install a gem that is not yet installed it downloads the index, gunzips it and unmarshals it. It then looks for dependencies that are described in another file that is also a gzipped and marshalled file. There are several issues that arise from this setup:

  • The full index must be downloaded and parsed, but does not contain dependency data, which must then be downloaded and parsed. This is a relatively time consuming process.
  • The index must be centralized.

Additionally the gems themselves are currently centralized since there is nothing in the meta data that indicates where the gem should be downloaded from. However in order to allow this it is important to find ways of keeping the index from being poisoned (is this an issue in the centralized system?)

Dependency Resolution