Skip to content

Instantly share code, notes, and snippets.

@mataki
mataki / xauth_sample_for_youroom.rb
Created July 15, 2010 02:05
youRoom xauth sample
require "rubygems"
require "oauth"
consumer_key = "consumer_key"
consumer_secret = "consumer_secret"
consumer = OAuth::Consumer.new(consumer_key,
consumer_secret,
:site => "https://www.youroom.in/")
@shisashi
shisashi / LongClickRepeatAdapter.java
Created February 1, 2012 19:03
AndroidのViewに、長押ししたらクリック処理をリピートする処理を付加するアダプタ
package net.shisashi.android.widget;
import android.os.Handler;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnLongClickListener;
import android.view.View.OnTouchListener;
public class LongClickRepeatAdapter {
@hayajo
hayajo / changelog_en.md
Last active June 27, 2024 02:39
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@jugyo
jugyo / to_factory_girl.rb
Created November 7, 2012 05:54
ActiveRecord extension to print FactoryGirl definition!
class ActiveRecord::Base
# Usage:
#
# > puts User.first.to_factory_girl
# FactoryGirl.define do
# factory :user do
# ...
# end
# end
# # Usage: FactoryGirl.create(:user, ...)
@authorNari
authorNari / gist:4083386
Created November 16, 2012 02:25
Top of Rubyist決定戦の回答: 再帰メモ化
N=10000
M=3
# 再帰・全探索
# i = 残りの数値
# j = 組み合わせ数
# 4 1 = 1
# 4 2 = 4 1 + (2 2 = 2 1 + (0 2 = 1) = 2) = 3
# 4 3 = ...
# O(2**n)?

2013 年の新卒研修メニュー

Rails Tutorial

目的

  • 2013 年で Web アプリケーションを作る時にモダンな方法で一通り Web アプリケーションを自分一人で作れるようになってもらう
  • 作る過程で Web 開発で必要とされるスキルセットを身につけてもらう

教材と教える項目

@patorash
patorash / PatorashRailscast.icls
Created April 18, 2013 01:59
/Users/******/Library/Preferences/RubyMine50/colors に設置すればいいのかな?
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="PatorashRailscast" version="124" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
<colors>
<option name="CARET_COLOR" value="ffffff" />
<option name="CARET_ROW_COLOR" value="333435" />
<option name="CONSOLE_BACKGROUND_KEY" value="2b2b2b" />
<option name="GUTTER_BACKGROUND" value="2b2b2b" />
@mataki
mataki / user.rb
Last active December 19, 2015 09:19
mailchimp sync sample
class User < ActiveRecord::Base
def subscribe_mailchimp_list(client = Gibbon.new)
if ENV["MAILCHIMP_LIST_ID"]
logger.info "add #{self.email} to list #{ENV["MAILCHIMP_LIST_ID"]}"
client.list_subscribe(id: ENV["MAILCHIMP_LIST_ID"],
email_address: self.email,
double_optin: false,
send_welcome: false,
update_existing: true,
merge_vers: {:FNAME => self.first_name,
@mattclar
mattclar / simple_form.rb
Last active December 21, 2015 13:58 — forked from tommarshall/simple_form.rb
this is a simple form initializer that is ALMOST compatible with Bootstrap3 apart from a way to set the class of the label this would work perfectly
# http://stackoverflow.com/questions/14972253/simpleform-default-input-class
# https://github.com/plataformatec/simple_form/issues/316
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput