- GitHub Staff
- https://bento.me/kyanny
- @kyanny
- in/kyanny
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "App.request", -> | |
deferred = null | |
beforeEach -> | |
deferred = $.Deferred() | |
sinon.stub(App, "request").returns deferred.promise() | |
afterEach -> | |
App.request.restore() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 | |
File.open('random.txt', 'w') do |file| | |
file.write(file_size.times.map { ascii.sample }.join) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Getopt::Long qw(HelpMessage VersionMessage); | |
use Term::ANSIColor qw(colored); | |
our $VERSION = '0.01'; | |
$VERSION = eval $VERSION; | |
my %color_map = ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# ldr2pin.rb - Livedoor ReaderのPinをまとめてpinboard.inにブックマークするスクリプト | |
# | |
$KCODE='utf8' | |
require 'rubygems' | |
require 'net/netrc' | |
require 'mechanize' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$: << 'lib' | |
require 'rubygems' | |
require 'gollum' | |
require 'gollum/frontend/app' | |
use Rack::ShowExceptions | |
Precious::App.set(:gollum_path, Dir.pwd) | |
Precious::App.set(:wiki_options, {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/cmplx" | |
) | |
// FIXME: | |
// Currently calculate only real part of the input | |
// complex number. |
OlderNewer