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
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> | |
<script type="text/javascript"> | |
$.ajax({ | |
dataType: "json", | |
url: "https://api.doorkeeper.jp/events", | |
headers: { 'Authorization': 'Bearer your_token' }, | |
data: {}, | |
success: function(data) { |
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
class CustomersController < ApplicationController | |
# … | |
def create | |
if auto_create_request? | |
@customer = Customer.auto_create(customer_params) | |
else | |
@customer = Customer.register(customer_params) | |
end | |
respond_to do |format| |
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
<link rel='stylesheet' type='text/css' href='http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/1.6.3/fullcalendar.css' /> | |
<script type='text/javascript' src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js'></script> | |
<script type='text/javascript' src='http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/1.6.3/fullcalendar.min.js'></script> | |
<script type="text/javascript"> | |
$.ajax({ | |
url: "http://api.doorkeeper.jp/groups/devlove/events.json", | |
dataType: "jsonp", | |
success: function (data) { | |
var events = jQuery.map(data, function(e){ | |
return { title: e.event.title, start: new Date(e.event.starts_at), end: new Date(e.event.ends_at), url: e.event.public_url, allDay: false}; |
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
ryopeko has left IRC (Remote host closed the connection) | |
kurko has joined (~textual@flets-b188.hbb.jp) | |
itochan is now known as itochan_off | |
ukstudio has left IRC (Ping timeout: 240 seconds) | |
shyouhei | |
sorah: squaleにいるのでそっちまはまかせた | |
volpe_hd28v has left IRC (Ping timeout: 240 seconds) | |
znz_ has left IRC (Ping timeout: 240 seconds) | |
znz_ has joined (~znz_@flets-b188.hbb.jp) | |
webgyo has left IRC (Quit: Leaving...) |
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
yokolet has joined (~yokolet@flets-b188.hbb.jp) | |
sorah has joined (~sorah@flets-b188.hbb.jp) | |
shyouhei | |
OK lets start | |
shyouhei | |
sqale is a PaaS | |
shyouhei | |
i'll talk about is core, backend | |
shyouhei | |
not that ruby related sorry :P |
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
# Is there already a pattern for doing this? | |
def map_find(enumerable) | |
enumerable.each do |e| | |
t = yield(e) | |
return t if t | |
end | |
nil | |
end | |
# equivalent to the following but with one less function call |
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
input[type='number'][size='2'] { | |
width: 26px; | |
} | |
input[type='number'][size='3'] { | |
width: 36px; | |
} |
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
input#profile_min_age, input#profile_max_age { | |
width: 26px; | |
} | |
input#profile_height, input#profile_min_seek_height, input#profile_max_seek_height { | |
width: 36px; | |
} |
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 ruby | |
# encoding: UTF-8 | |
require "boundio" | |
require "csv" | |
include Boundio | |
greeting = AudioFile.create(:convtext => "こんにちは、") | |
message = AudioFile.create(:convtext => "さん。") | |
CSV.parse($stdin) do |row| |
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
# allows directly accessing the locale specific fields such as text_en and text_ja without using fallbacks | |
module GlobalizeAccessors | |
def translates(*attr_names) | |
super | |
attr_names.each do |attr_name| | |
I18n::AVAILABLE_LOCALES.map(&:to_sym).each do |locale| | |
# writer | |
define_method :"#{attr_name}_#{locale}=" do |value| | |
write_attribute(attr_name, value, :locale => locale) | |
end |
NewerOlder