Skip to content

Instantly share code, notes, and snippets.


Kensuke Nagae kyanny

View GitHub Profile
twilson63 /
Created Jul 31, 2011
Common CoffeeScript Idoms - from the little book on CoffeeScript

Common CoffeeScript Idoms


myfunction(item) for item in items


wsargent / gist:1258640
Created Oct 3, 2011
Setting up a base vagrant box for Oracle
View gist:1258640
Install instructions for 10.2:
[Required files]
tricknotes /
Created Nov 12, 2011 for gollum
require 'rubygems'
require 'bundler/setup'
require 'gollum/frontend/app'
Precious::App.set(:gollum_path, File.dirname(__FILE__))
Precious::App.set(:wiki_options, {})
run Precious::App
View base_model.rb
# app/models/my_model.rb
module MyApp
module Model
def self.included(base)
base.send :include, Mongoid::Document
base.send :include, Mongoid::Timestamps
base.send :include, ActiveAdmin::Mongoid::Patches
simenbrekken / add.js
Created Nov 24, 2011
Backbone.js form submission
View add.js
], function(Backbone, _, ProjectFormView) {
var View = Backbone.View.extend({
events: {
'submit form': 'submit'
fairchild / Gemfile
Created Dec 7, 2011
An example sinatra omniauth client app
View Gemfile
source :rubygems
gem 'sinatra'
gem 'json'
gem 'omniauth'
gem 'omniauth-oauth2'
gem 'omniauth-github'
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__)
gem 'thin'
flavio / gemfile_lock2geminabox.rb
Created Feb 2, 2012
Parse Gemfile.lock, download all gems from rubygems and then upload them to a local instance of geminabox
View gemfile_lock2geminabox.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler'
require 'fileutils'
require 'net/http'
require 'net/https'
require 'uri'
TMP_DIR = "/tmp/gems"
jgorset / gist:1747655
Created Feb 5, 2012
How Sprockets works with JST and EJS templates
View gist:1747655
// This document distills the magic that happens when you create a file with the ".jst"
// and ".ejs" extensions anywhere on your asset path in Ruby on Rails, courtesy of the
// Sprockets library (
// For the purpose of this example, imagine that you have created a template for
// messages in `app/assets/javascripts/backbone/templates/messages/message.jst.ejs`
// with the following contents:
// <h1><%= user.full_name %></h1>
// <p><%= body %></p>
larsrottmann / active_admin_mongomapper_patches.rb
Created Feb 15, 2012
Enable basic MongoMapper support in ActiveAdmin
View active_admin_mongomapper_patches.rb
# config/initializers/active_admin_mongomapper_patches.rb
require "active_admin"
require "active_admin/resource_controller"
require 'ostruct'
module ActiveAdmin
class Namespace
# Disable comments
def comments?
tetsuok / complex_cube_root.go
Created Apr 2, 2012
An answer of the advanced exercise: complex cube roots on a tour of Go
View complex_cube_root.go
package main
import (
// Currently calculate only real part of the input
// complex number.