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 Main{ | |
public static void main(String args[]){ | |
String name = "Saito"; | |
String password = "a1c2bf1890eb"; | |
String url = "http://localhost:9292/Saito/simba.git"; | |
// credentials | |
CredentialsProvider cp = new UsernamePasswordCredentialsProvider(name, password); | |
// clone | |
File dir = new File("/tmp/abc"); |
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 bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p286.tar.gz | |
tar -xvzf ruby-1.9.3-p286.tar.gz | |
cd ruby-1.9.3-p286/ | |
./configure --prefix=/usr/local | |
make | |
make install |
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
// | |
// main.m | |
// koans | |
// | |
// Created by Saito on 4/13/12. | |
// Copyright (c) 2012 Yava Exchange. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
:~$ rvm use jruby | |
Using /home/saito/.rvm/gems/jruby-1.6.2 | |
:~$ gem i mvn:org.slf4j:slf4j-simple | |
Successfully installed mvn:org.slf4j:slf4j-api-1.6.2-java | |
Successfully installed mvn:org.slf4j:slf4j-simple-1.6.2-java |
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
require 'twitter' | |
Twitter.configure do |config| | |
config.consumer_key="8n30gzQJFwcexyrnbKFTqw" | |
config.consumer_secret="tzwvlxUyENhFEvX2bj0mDevSSLCMVNjY1zhM2O2Z5E" | |
config.oauth_token="34916016-Qph9S5HS2FyDcVIEYIraswexmYpBBRqnLoX6e1ncZ" | |
config.oauth_token_secret="8nkOjeYUK3RO5bRySz3YIYYiOc4mPxjxZM8GVoHDs" | |
end | |
client = Twitter::Client.new |
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
require 'fiber' | |
fib = Fiber.new do | |
v = 0 | |
loop do | |
v += 1 | |
Fiber.yield v | |
v.times { print "-"} | |
puts v | |
end |
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
#rubbish showoff | |
#libxslt is missing or libxml2 | |
sudo apt-get install libxslt-dev libxml2-dev | |
gem install rmagick | |
#Can't find Magick-config or GraphicsMag ick-config program. | |
sudo apt-get install libmagick9-dev |
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
require 'mongoid' | |
Mongoid.configure do |config| | |
name = "db" | |
host = "localhost" | |
config.master = Mongo::Connection.new.db(name) | |
config.slaves = [ | |
Mongo::Connection.new(host, 27017, :slave_ok => false).db(name) | |
] | |
config.persist_in_safe_mode = 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
def block_new | |
puts Proc.new.call | |
end | |
block_new{"hello"} | |
#slow practice | |
def herp_pass_block(&block) | |
derp_call_block &block | |
end |
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
#Person | |
class Person | |
end | |
#class method | |
class Person | |
def self.address | |
puts "hangzhou" | |
end | |
end |