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
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.security.KeyManagementException; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.cert.X509Certificate; |
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
import play._ | |
import play.test._ | |
import org.scalatest._ | |
import org.scalatest.junit._ | |
import org.scalatest.matchers._ | |
class BasicTests extends UnitFlatSpec with ShouldMatchers with BeforeAndAfterEach { | |
override def beforeEach() { |
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
List(192, 168, 1, 1).mkString(".") // "192.168.1.1" |
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
# http://twitter.com/#!/yuroyoro/status/101510384883728385 | |
k,*v = [1,2,3] | |
#k => 1 | |
#v => [2,3] | |
x,y,*v = [1,2,3,4] | |
#x => 1 | |
#y => 2 | |
#v => [3,4] |
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
# Rails3の場合Gemfileの修正も忘れずに… | |
gem 'mongrel', '>= 1.2.0.pre2' |
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 | |
files = ARGV.map {|f| File.open(f)} | |
DT_PARSE = /[^\[]+\[([0-9]+)\/([A-z0-9]+)\/([0-9]+):([0-9]+):([0-9]+):([0-9]+) ([0-9+-]+)\].+/ | |
MONTH = { | |
'Jan'=>0,'Feb'=>1,'Mar'=>2,'Apr'=>3,'May'=>4,'Jun'=>5, | |
'Jul'=>6,'Aug'=>7,'Sep'=>8,'Oct'=>9,'Nov'=>10,'Dec'=>11} | |
class PreRead | |
attr_accessor :file, :line, :dt |
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
#include <stdio.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
typedef struct preread { | |
FILE* file; | |
char *line_buf; | |
int dt; |
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
# -*- coding: utf-8 -*- | |
require 'test/unit' | |
require_relative '../target-source-file' | |
class TargetClassTest < Test::Unit::TestCase | |
def setup | |
end | |
def teardown | |
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
rvm get head | |
rvm reload | |
rvm install 1.9.3 |
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
CREATE TABLE t_member ( | |
id INTEGER PRIMARY KEY AUTOINCREMENT, | |
name TEXT NOT NULL, | |
registered_at INTEGER NOT NULL, | |
deleted_at INTEGER | |
); |