Skip to content

Instantly share code, notes, and snippets.

View Thorsson's full-sized avatar
🎯
Focusing

Ivan Turkovic Thorsson

🎯
Focusing
View GitHub Profile
@Thorsson
Thorsson / gist:50552
Created January 22, 2009 14:23 — forked from mislav/gist:13809
Coool
Xcode
http://developer.apple.com/technology/xcode.html
[OR]
Mac OS X install disc 2
GNU wget
http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz
Git
http://code.google.com/p/git-osx-installer/
# This is a script to install both ruby 1.8.7 and 1.9.1, with suffixed binaries and symlinks
mkdir -p /usr/local/src ; cd /usr/local/src
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.bz2
tar -xjvf ruby-1.8.7-p72.tar.bz2
cd ruby-1.8.7-p72
./configure --prefix=/usr --program-suffix=18 --enable-shared
make && sudo make all install
cd /usr/local/src
//
// EGOCache.h
// enormego
//
// Created by Shaun Harrison on 7/4/09.
// Copyright 2009 enormego. All rights reserved.
//
#import <Foundation/Foundation.h>
var geo = navigator.geolocation || (window.google && google.gears && google.gears.factory.create('beta.geolocation'));
if (geo) geo.getCurrentPosition(displayLocation, handleError);
function displayLocation(position) {
position.coords.latitude;
position.coords.longitude;
position.coords.accuracy;
}
function handleError(error) {
#!/bin/bash
# run with: curl -s http://gist.github.com/265272.txt | bash
set -e
localdir=$HOME/.mongodb
datadir=$localdir/data
conf=$localdir/mongod.conf
agentdir=$HOME/Library/LaunchAgents
agent=$agentdir/org.mongodb.mongod.plist
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript
powered JS and SASS powered CSS with YUI compression all via the magic of rack.
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist.
@Thorsson
Thorsson / 0_instructions.txt
Created May 13, 2011 09:43 — forked from eric1234/0_instructions.txt
Using Sprockets 2 in Rails 3.0.x with CoffeeScript & SASS
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript
powered JS and SASS powered CSS with YUI compression all via the magic of rack.
This stuff will be native in Rails 3.1 and the layout of the files on the
filesystem will be different but this guide will get you working with it
while we wait for all that to finalize.
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist.
class ToHaml
def initialize(path)
@path = path
end
def convert!
Dir["#{@path}/**/*.erb"].each do |file|
`html2haml -rx #{file} #{file.gsub(/\.erb$/, '.haml')}`
end
end
@Thorsson
Thorsson / paginated_collection.js
Created February 15, 2012 12:26 — forked from zerowidth/paginated_collection.js
first whack at pagination with backbone.js
// includes bindings for fetching/fetched
PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
this.page = 1;
},
fetch: function(options) {
options || (options = {});
this.trigger("fetching");
@Thorsson
Thorsson / jst2haml.sh
Created February 15, 2012 13:09 — forked from eric-hu/jst2haml.sh
short shell script for converting jst.ejs files to jst.ejs.haml files for haml_assets
# bin/bash
# Converts jst.ejs files into jst.ejs.haml files
# Adapted from: http://shifteleven.com/articles/2008/06/08/converting-erb-to-haml-snippet
#
# Run this script from the root of your Rails project directory (or other language of your choice)
#
# It will output one line for each file it'll convert. Look the list over and verify that everything
# looks right. Once you're certain (I suggest doing a backup/git commit at this point), run:
#
# jst2haml | bash