Skip to content

Instantly share code, notes, and snippets.

View muescha's full-sized avatar

Muescha muescha

View GitHub Profile
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@david-mark
david-mark / gist:3279190
Created August 6, 2012 22:47
Sencha Touch Still Sucks

Was asked to look at this thing again; only reviewed the JS portion. Last I checked, the CSS was similarly reality-challenged. Graphics are nice, but are tantamount to the paint job on a used car. Under the hood, this thing is all junk. It's hard to imagine the innards of any Web or mobile device-based application would end up like this, which raises the question of whether the authors have ever written such applications (or any amount of meaningful JS).

/**
 * @class Ext
 * @singleton

There (still) are no "classes" or "singletons" in JS (starting off on the wrong foot by mangling JS terms).

@seanlilmateus
seanlilmateus / gist:3187192
Last active March 5, 2021 07:17
How to use Obj-C with MacRuby/Rubymotion

Using Obj-C with MacRuby/Rubymotion

This little post aims to help you to translate Objective-C Blocks into Ruby blocks. Let's start by taking a look at few examples of iOS API call where blocks are used for animations and enumeration

Ruby Lambda Syntaxes:

Im Rubymotion and MacRuby you can use all the Ruby Lambda syntaxes that are:

block = lambda { |param|  ... }
@ParkinT
ParkinT / Rakefile
Last active October 7, 2015 07:18
RubyMotion Rakefile - improved workflow
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
# custom rake tasks
require '../raketasks/gemerator.rb'
desc "Open latest crash log"
task :log do
app = Motion::Project::App.config
@maccman
maccman / juggernaut.rb
Created June 26, 2012 02:49
Sinatra Server Side Event streaming.
# Usage: redis-cli publish message hello
require 'sinatra'
require 'redis'
conns = []
get '/' do
erb :index
end
@MicahElliott
MicahElliott / rbenv-howto.md
Created April 17, 2012 18:11
Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

@stevebourne
stevebourne / Gemfile
Created April 15, 2012 19:28
Add facebook auth to a Clearance app, using omniauth-facebook
gem 'omniauth'
gem 'omniauth-facebook'
gem 'clearance'
@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
@carlhoerberg
carlhoerberg / gist:976228
Created May 17, 2011 09:59
How to list DataMapper enum options
class Entity
include DataMapper::Resource
property :enum_property, Enum[:a, :b, :c]
end
Entity.enum_property.options[:flags] #=> [:a, :b, :c]
# or
Entity.enum_property.flag_option.values #=> [:a, :b, :c]