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
View a.rb
$ curl -s https://rubygems.org/api/v1/gems/diff-lcs.json
{
"dependencies": {
"runtime": [],
"development": [
{
"requirements": "~> 3.7",
"name": "hoe"
},
View patch.diff
changeset: 203:31902182b995
branch: no35_translation
tag: tip
user: Kensuke Nagae <kyanny@gmail.com>
date: Thu Mar 20 02:51:03 2014 +0900
summary: Fix Japanese translation of No.35
diff -r c892a61a8dc7 -r 31902182b995 content/tour.article.jp
--- a/content/tour.article.jp Thu Jan 09 21:23:38 2014 +0900
+++ b/content/tour.article.jp Thu Mar 20 02:51:03 2014 +0900
View gist:9724794
package main
import "fmt"
func adder (n int) func() int {
sum := 0
return func () int {
sum += n
return sum
}
@kyanny
kyanny / 01_test.rb
Last active Aug 29, 2015
Inconsistent results of Draper::Decorator#decorate_collection and Draper:: Decoratable#decorate
View 01_test.rb
require 'rails'
require 'mongo_mapper'
require 'draper'
require 'rspec'
MongoMapper.database = 'testing'
MongoMapper::Document.send(:include, Draper::Decoratable)
class Bookmark
include MongoMapper::Document
@kyanny
kyanny / gist:11023320
Created Apr 18, 2014
$ ruby -e 'loop.with_index{|i,j| p [i,j]}' > a.txt
View gist:11023320
[nil, 0]
[nil, 1]
[nil, 2]
[nil, 3]
[nil, 4]
[nil, 5]
[nil, 6]
[nil, 7]
[nil, 8]
[nil, 9]
@kyanny
kyanny / Gemfile
Created May 17, 2014
newrelic_rpm 3.8.1.221 and newrelic-grape crash minimum replicate code: uninitialized constant NewRelic::MetricSpec (NameError)
View Gemfile
source "https://rubygems.org"
gem 'grape'
gem 'newrelic_rpm', '3.8.1.221'
gem 'newrelic-grape'
@kyanny
kyanny / capybara
Last active Aug 29, 2015
Capybara console
View capybara
#!/usr/bin/env ruby
require 'pry'
require 'capybara/dsl'
require 'capybara/poltergeist'
require 'uri'
include Capybara::DSL
Capybara.default_driver = :poltergeist
View deferred_spec.coffee
describe "App.request", ->
deferred = null
beforeEach ->
sinon.stub(App, "request").yieldsTo('done', {res: "ok"})
afterEach ->
App.request.restore()
You can’t perform that action at this time.