Skip to content

Instantly share code, notes, and snippets.

View jacoyutorius's full-sized avatar
🏠
Working from home

jacoyutorius jacoyutorius

🏠
Working from home
View GitHub Profile
@jacoyutorius
jacoyutorius / webapi.rb
Created October 29, 2012 03:49
using GeocodingAPI
#encoding: utf-8
require "rubygems"
require "open-uri"
require "json"
require "active_support/core_ext"
require "pp"
print "Content-Type:text/html\r\n\r\n"
address = "hamamatsu"
#encoding:utf-8
require "rubygems"
require "pp"
require "koala"
token = "accesstoken"
@graph = Koala::Facebook::API.new(token)
# profile = @graph.get_object("me")
friends = @graph.get_connections("me" , "friends")
@jacoyutorius
jacoyutorius / Rakefile
Created April 10, 2013 08:42
Coding-dojo Rakefile
namespace :dojo do
desc "When you greet 'osu!' , gate of the 'dojo' would open."
task :osu! do
dir = ENV["dojo_name"]
fail "please specify 'dojo_name'" unless dir
sh "mkdir #{dir}"
Dir::chdir(dir) do
sh "rspec --init"
@jacoyutorius
jacoyutorius / file0.txt
Last active April 1, 2017 04:56
Railsで既存のテーブルをModelとして使用する ref: http://qiita.com/jacoyutorius/items/86691266b63f967f47d3
$rails g model hogehoge
@jacoyutorius
jacoyutorius / twilio_call.rb
Created April 25, 2013 15:44
Twilio APIを使って℡をかけるサンプル
require "rubygems"
require "yaml"
require "twilio-ruby"
config = YAML.load(File.read(File.join(File.dirname(__FILE__), '..', 'config.yml')))
if !config
print "config.yml does not found!"
end
@jacoyutorius
jacoyutorius / file0.txt
Created June 14, 2013 07:24
ActiveRecordでSQLServerへ接続する ref: http://qiita.com/items/43848e4246fbe513cf4c
source "https://rubygems.org"
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter'
gem 'arel', '~> 3.0.2'
gem "tap"
gem "ruby-odbc"
gem "dbi"
gem "dbd-odbc"
gem "logger"
<html lang="ja">
<head>
<meta charset="utf-8">
<title>jQueryのテスト</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="./scripts/jquery.bxslider.min.js"></script>
<link rel="stylesheet" href="./css/jquery.bxslider.css" type="text/css" />
<script>
$(document).ready(
function(){
@jacoyutorius
jacoyutorius / Vagrantfile
Last active December 21, 2015 11:59
Ubuntu用VagrantFile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise32"
@jacoyutorius
jacoyutorius / bootstrap.sh
Last active December 21, 2015 11:59
Vagrantプロビジョニング用シェルスクリプト が、26行目の処理あたりで止まる。原因不明・・・
#!/usr/bin/env bash
apt-get update
apt-get upgrade
apt-get install -y apache2
#rm -rf /var/www
#ln -fs /vagrant /var/www
apt-get install vim
@jacoyutorius
jacoyutorius / default.rb
Created August 28, 2013 11:00
オレオレChef
# apt_package "apt-get upgrade" do
# action :upgrade
# end
package "apache2" do
action :install
ignore_failure true
end
package "git" do