Skip to content

Instantly share code, notes, and snippets.

@igaiga
igaiga / im-kayac-post.rb
Last active October 13, 2015 07:28
im-kayac
# $ gem i im-kayac
# http://im.kayac.com/
require 'im-kayac'
user = 'USER'
password = 'PASSWORD'
message = ARGV[0] ? ARGV[0].to_s : 'blank'
begin
p ImKayac.to(user).password(password).post(message)
rescue => e
STDERR.puts e
@igaiga
igaiga / gist:4258213
Created December 11, 2012 12:28
igaiga cfp
Community Changes Education
Ruby on Rails has become a major tool for web application development, but it's not commonly used in teaching web technology in university. The main reason is the evolution speed of Rails and web technology. It's difficult to catch up with edge technology for teachers in their spare time. This is time for us to help university teachers how to teach rails and latest technology.
This is the reason why I started "Rails Terakoya". "Terakoya" means an ancient private school system in Japan. At a Rails Terakoya workshop, university students and teachers learn how to develop web applications and create some pretty applications with Rails.
In this talk, I'll talk about how to teach Rails to various level students especially people studying programming for the first time, how to connect and collaborate student communities, and how to approach education institutions to expand Rails Terakoya, through my experience.
And I want to share with you the joy of teaching and learning rails!
@igaiga
igaiga / CFP
Created December 15, 2012 07:44
My dream is creating a new style computer science college. In there, many star engineers in communities are teaching edge technologies as part-time lecturer and research collaborating with the students. After school ours, there are many hackthons and tech meetups for students and programmers in company. Don't you think that's nice spaces? If we start activities by now, we can change education system and schools when our sons entrance into university. :)
# -*- coding: utf-8 -*-
# Gemfile へ gem 'rspec-rails' を追加
# $ rails g rspec:install
require 'spec_helper'
# テストしたいクラス Foo
# 普通は
class Foo
おなじみのscaffold appを作る
Gemfileのgroup :assetsに追加
gem "twitter-bootstrap-rails"
$ bundle install
$ bundle exec rails g bootstrap:install
$ bundle exec rails g bootstrap:layout application fluid
// install: $ npm install treehash
// usage: $ node thisfile.js
// github: https://github.com/Picturelife/treehash
var file_name = './foo.zip'
var fs = require('fs');
var treehash = require('treehash');
var thStream = treehash.createTreeHashStream ();
var fileStream = fs.createReadStream(file_name);
#!/bin/zsh
echo "Delete SD card data? [y/n]"
read yn
case $yn in
[Yy]* ) echo "Deleting..." ;;
[Nn]* ) exit;;
* ) echo "Please answer y or n.";exit;;
esac
pushd /Volumes/NO\ NAME/
# gem install terminal-notifier
# $ terminal-notifier -message "hello world" -title "やっほー"
# -*- coding: utf-8 -*-
require "twitter"
Twitter.configure do |config|
config.consumer_key = "consumer_key"
config.consumer_secret = "consumer_secret"
config.oauth_token = "oauth_token"
config.oauth_token_secret = "oauth_token_secret"
end
@igaiga
igaiga / anything.sh
Last active December 12, 2015 05:08
# shell command anything using canything and tmux
# for mac
alias h="history -10000 | sed -e 's/^\s*[0-9]*\s*//' | tail -r | canything | sed -e 's/^(.*)$/\"\0\"/' | xargs tmux send-keys " #input edition
# for linux
alias h="history -10000 | sed -e 's/^\s*[0-9]*\s*//' | tac | canything | sed -e 's/^.*$/\"\0\"/' | xargs tmux send-keys" #input edition