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
use std::env; | |
use chrono::prelude::DateTime; | |
fn main() { | |
let args: Vec<String> = env::args().collect(); | |
if args.len() < 2 { | |
println!("argument is unixtime"); | |
return; | |
} |
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 Hoge | |
def get_v | |
@@v ||= 123 | |
end | |
class << self | |
def inc_v | |
@@v ||= 0 | |
@@v += 1 | |
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
$ sudo apt-get install python-software-properties | |
$ sudo add-apt-repository ppa:webupd8team/java | |
$ sudo apt-get update | |
$ sudo apt-get install oracle-java7-installer |
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
$ unzip typesafe-activator-1.3.7-minimal.zip | |
$ mv ~/Downloads/activator-1.3.7-minimal ~/local | |
$ ln -s ~/local/activator-1.3.7-minimal/activator ~/bin/activator | |
$ chmod +x ~/local/activator-1.3.7-minimal/activator | |
$ mkdir play2.4.6_test | |
$ cd play2.4.6_test/ |
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
$ ruby bench.rb | |
Rehearsal ---------------------------------------------------- | |
encode with oj 14.880000 0.020000 14.900000 ( 14.900684) | |
encode with json 95.250000 0.020000 95.270000 ( 95.261347) | |
----------------------------------------- total: 110.170000sec | |
user system total real | |
encode with oj 15.220000 0.000000 15.220000 ( 15.229005) | |
encode with json 95.140000 0.060000 95.200000 ( 95.211977) |
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 "sinatra" | |
require "sinatra/multi_route" | |
route :get, :post, "/" do | |
"hello" | |
end | |
set(:auth) do |role| | |
condition do | |
if role == :logged_in |
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/php | |
<?php | |
function is_palindrome($str) { | |
return $str == join('', array_reverse(str_split($str))); | |
} | |
foreach (array('level', 'hoge') as $str) { | |
if (is_palindrome($str)) { | |
echo "$str is palindrome!\n"; | |
} |
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
#!/bin/sh | |
rm /var/lib/dhcp/* | |
rm -f /etc/udev/rules.d/70-persistent-net.rules | |
rm -f /etc/resolv.conf | |
dd if=/dev/zero of=/EMPTY bs=1M | |
rm /EMPTY |
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
vagrant@ubuntu1204:~$ mysql -u root -p | |
Enter password: | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 47 | |
Server version: 5.5.31-0ubuntu0.12.04.1 (Ubuntu) | |
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. | |
Oracle is a registered trademark of Oracle Corporation and/or its | |
affiliates. Other names may be trademarks of their respective |
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
requires 'Getopt::Long'; | |
requires 'PDF::API2'; |
NewerOlder