Skip to content

Instantly share code, notes, and snippets.

Kensuke Nagae kyanny

Block or report user

Report or block kyanny

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
describe "App.request", ->
deferred = null
beforeEach ->
deferred = $.Deferred()
sinon.stub(App, "request").returns deferred.promise()
afterEach ->
willnet / create_image.rb
Created Mar 27, 2015
create image whose file size you can specify for test
View create_image.rb
# brew install imagemagick exiftool
system('convert -size 128x128 xc:blue test.jpg')
file_size = 1_048_576 - 448
ascii = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a'random.txt', 'w') do |file|
file.write( { ascii.sample }.join)
rcrowley / gist:447393
Created Jun 21, 2010
Resque Nagios plugin
We couldn’t find that file to show.
View escfilter
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long qw(HelpMessage VersionMessage);
use Term::ANSIColor qw(colored);
our $VERSION = '0.01';
my %color_map = (
yoggy / ldr2pin.rb
Created Jan 12, 2011
Livedoor ReaderのPinをまとめてpinboard.inにブックマークするスクリプト
View ldr2pin.rb
# ldr2pin.rb - Livedoor ReaderのPinをまとめてpinboard.inにブックマークするスクリプト
require 'rubygems'
require 'net/netrc'
require 'mechanize'
tobert /
Created May 18, 2011
Gollum rackup for Unicorn
$: << 'lib'
require 'rubygems'
require 'gollum'
require 'gollum/frontend/app'
use Rack::ShowExceptions
Precious::App.set(:gollum_path, Dir.pwd)
Precious::App.set(:wiki_options, {})
twilson63 /
Created Jul 31, 2011
Common CoffeeScript Idoms - from the little book on CoffeeScript

Common CoffeeScript Idoms


myfunction(item) for item in items


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
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?
You can’t perform that action at this time.