I hereby claim:
- I am kuboon on github.
- I am kuboon (https://keybase.io/kuboon) on keybase.
- I have a public key ASCbNuTLzZAuy_vOaGq6vLnF2LjZ4xGSUjC-so2U8gV3swo
To claim this, I am signing this object:
gem 'acts-as-taggable-on' | |
gem 'simple_form' | |
gem 'select2-rails' |
#!ruby | |
require 'drb/drb' | |
require 'logger' | |
require "rack" | |
require 'rack/rewindable_input' | |
module Dispatch | |
RAILS_ENV = 'staging' | |
DRUBY_URI = "druby://localhost:13141" | |
LOCKFILE = "../tmp/pids/dispatch.pid" |
gem 'quiver_note' | |
class MyEvernote | |
NOTE_NAME = 'public' | |
USERNAME = 'kuboon' | |
def client | |
@client ||= EvernoteOAuth::Client.new(token: auth_token, sandbox: false) | |
end |
// Description: | |
// Slack の channel で点呼をとる | |
// https://gist.github.com/kuboon/8c66bf61a170bc49f99e5fe91352bb6f | |
// Commands: | |
// hubot 点呼 | |
// Dependencies: | |
// "aa": "^0.1.40" | |
// "slack-node": "^0.1.3" | |
// "hubot-redis-brain" |
# lib/tasks/db_fixtures_export.rake | |
namespace 'db:fixtures' do | |
desc "generate fixtures from the current database" | |
task :export => :environment do | |
Rails.application.eager_load! | |
models = defined?(AppicationRecord) ? ApplicationRecord.decendants : ActiveRecord::Base.descendants | |
models.each do |model| | |
puts "exporting: #{model}" |
# views/fields/belongs_to_scoped/_form.html.erb | |
<div class="field-unit__label"> | |
<%= f.label field.permitted_attribute %> | |
</div> | |
<div class="field-unit__field"> | |
<%= f.select(field.permitted_attribute) do %> | |
<%= options_for_select(field.associated_resource_options(f.object.send("#{field.name}_candidates")), field.selected_option) %> | |
<% end %> | |
</div> |
I hereby claim:
To claim this, I am signing this object:
Huge *n1 = huge_from_long(12); | |
Huge *n2 = huge_from_long(3); | |
Huge *result; | |
result = huge_add(n1, n2); | |
printf("%d", huge_as_long(result)); // 15 | |
huge_free(result); | |
result = huge_sub(n1, n2); |
require 'prime' | |
# backport ruby 2.4 | |
class Array | |
def sum(identity = 0, &block) | |
if block_given? | |
map(&block).sum(identity) | |
else | |
inject { |sum, element| sum + element } || identity | |
end |
import functools, itertools, random, math | |
from sympy.combinatorics import Permutation | |
def cycle_rounds(p1, p2, verbose = False): | |
'''detect all cycles in p1 how many times rounded in p2 | |
Usage: | |
>>> p = Permutation(10)(2,3,4,5)(6,7) | |
>>> cycle_rounds(p,p**3) | |
[(1, 2), (3, 4)] |