Skip to content

Instantly share code, notes, and snippets.

@sowawa
sowawa / crs_test.rb
Created January 17, 2012 13:23
Compressed Row Storage, CRS for sparse matrix
require 'pp'
class CRS
attr_reader :col_indexes, :row_pointers
def initialize data
# @vals = [] not used
@col_indexes = []
@row_pointers = []
@n = nil
counter = 0
@sowawa
sowawa / cmd_utils.rb
Created February 2, 2012 20:46
get cmd output by ruby.
module CMDUtils
def get_cmd_output cmd
output = ''
IO.popen(
cmd
) do |io|
output = io.read()
end
output
end
@sowawa
sowawa / .gitignore
Created February 7, 2012 00:26
mongodb for rackhub.
mongodb.log
db/*
@sowawa
sowawa / README
Created February 7, 2012 01:32
Erlang prcatice with rackhub.
This is erlang practice.
@sowawa
sowawa / HelloWorld.java
Created February 7, 2012 01:40
Hello Java in rackhub.
public class HelloWorld {
public static void main (String[] args) {
System.out.println("Hello. Rackhub meets Java!");
}
}
@sowawa
sowawa / README.md
Created February 7, 2012 02:04
Sinatra

This is ruby practice using sinatra.

cd
rvm 1.9.2
rvm gemset create sandbox
rvm 1.9.2@sandbox
git clone git://gist.github.com/1756617.git sinatra
cd sinatra
gem install sinatra
@sowawa
sowawa / README.md
Created February 7, 2012 02:19
phpinfo in cli

Do you know to be able to phpinfo() in cli.

git clone git://gist.github.com/1756687.git php
cd php
php info.php
@sowawa
sowawa / README.md
Created February 7, 2012 02:30
server.js

This is node.js practice in rackhub.

cd
cd nave
./nave.sh use 0.7.2
cd
git clone git://gist.github.com/1756736.git node
cd node
node server.js
@sowawa
sowawa / start.sh
Created February 8, 2012 15:56
The most simple web server using ruby.
#!/bin/bash
ruby -run -e httpd -- --port=3000 .
@sowawa
sowawa / README.md
Created March 14, 2012 16:28
Wordpress for rackhub

wordpress

cd
git clone git://gist.github.com/2037654.git wordpress-installer
cd wordpress-installer
bash init.sh