Skip to content

Instantly share code, notes, and snippets.

View shuhei's full-sized avatar
🐶
This is fine

Shuhei Kagawa shuhei

🐶
This is fine
View GitHub Profile
@seratch
seratch / bot.md
Last active August 29, 2015 14:05
Twitter Bot for Web Designers

Twitter Bot つくろうず

Twitter Bot ってどういう仕組み?

A Twitterbot is a program used to produce automated posts on the Twitter microblogging service, or to automatically follow Twitter users. (Wikipedia)

利用者の Twitter アカウント関する操作権限をもらって何かするもの。つぶやいたり、フォローしたり、ふぁぼったり。

Ruby でやる

@rkh
rkh / sinatra_app_instance_in_spec.rb
Created October 27, 2011 05:45 — forked from duien/sinatra_app_instance_in_spec.rb
Get access to the Sinatra application instance that ran the current test in Rack::Test. Created by @bsiggelkow
describe LeadService do
LeadService.configure(:test) do
before { settings.set(:instance, self) }
end
# Required for Rack::Test
#
def app
LeadService
@collinschaafsma
collinschaafsma / rails-grunt.js
Created April 10, 2012 03:43
Grunt config for Rails
// This is the main application configuration file. It is a Grunt
// configuration file, which you can learn more about here:
// https://github.com/cowboy/grunt/blob/master/docs/configuring.md
//
module.exports = function(grunt) {
grunt.initConfig({
// The clean task ensures all files are removed from the dist/ directory so
// that no files linger from previous builds.
@ttscoff
ttscoff / growlnotify.rb
Created August 1, 2012 11:18
Seamless drop-in to turn existing growlnotify calls into Mountain Lion Notifications
#!/usr/bin/env ruby
# encoding: utf-8
# == Synopsis
# Requires the terminal-notifier gem ([sudo] gem install terminal-notifier)
# growlnotify wrapper to turn Growl alerts into Mountain Lion notifications
# Uses growlnotify option syntax to keep your old scripts working with the new shiny.
#
# If you use Growl via growlnotify in your shell scripting, this script
# will replace Growl's alerts with Mountain Lion notifications.
@rummelonp
rummelonp / tenkaichi-git.md
Created November 21, 2012 02:48 — forked from teppeis/tenkaichi-git.md
天下一gitconfig大会

ぎっとぎとにしてやんよ

DojoCat

  • gistでmarkdown書いたらbookmarkletでプレゼンになるよ。
  • ↓これをBookmarkに登録してこのページで実行してみよー!
@tcannonfodder
tcannonfodder / testem.json
Last active December 10, 2015 18:08
This is a bare-minimum testem configuration file that will allow you to use testem with a rails project. You save it in the root directory of the project (at the same level as the Gemfile), and then you can navigate to the project and run testem. How it works: What this configuration does is precompile the assets before the tests are run using t…
{
"framework": "jasmine",
"src_files": [
"app/assets/javascripts/*.js",
"spec/scripts/*.js"
],
"serve_files": [
"public/assets/*.js",
"spec/scripts/*.js"
],
@yllan
yllan / GO63Channel.scala
Last active December 15, 2015 16:49
Rewrite the Go tutorial of goroutine with scala.concurrent.
// Rewrite http://tour.golang.org/#63 to scala using Channel
import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global
object GO63Channel extends App {
def sum(a: List[Int], c: Channel[Int]) = future {
c write a.sum
}
val c = new Channel[Int]()
@ericboehs
ericboehs / gist:7125105
Created October 23, 2013 19:30
Poltergeist hack to silence CoreText performance notes from phantomjs
module Capybara::Poltergeist
class Client
private
def redirect_stdout(to)
prev = STDOUT.dup
prev.autoclose = false
$stdout = to
STDOUT.reopen(to)
prev = STDERR.dup
@duien
duien / sinatra_app_instance_in_spec.rb
Created April 15, 2010 17:25
Get access to the Sinatra application instance that ran the current test in Rack::Test. Created by @bsiggelkow
describe LeadService do
# Get the Sinatra application instance that ran the current test. For instance you
# could use:
#
# it "should set an instance variable" do
# get '/'
# app_instance.instance_variable_get(:@lead).should_not be_nil
# end
#
@vlado
vlado / gist:7713285
Last active December 29, 2015 18:49 — forked from ericboehs/gist:7125105
Fork of @ericboehs Poltergeist hack to silence CoreText performance notes from phantomjs My changes: 1. to is now optional parameter, if not provided @write_io is used 2. option to easily add more messages to suppress (I added this one WARNING: Method userSpaceScaleFactor in class NSView is deprecated)
module Capybara::Poltergeist
class Client
private
def redirect_stdout(to = nil)
to ||= @write_io
prev = STDOUT.dup
prev.autoclose = false
$stdout = to
STDOUT.reopen(to)