Skip to content

Instantly share code, notes, and snippets.

Avatar
💩
俺ら生きてて良いすかお偉いさ〜ん?

Shouichi Kamiya shouichi

💩
俺ら生きてて良いすかお偉いさ〜ん?
View GitHub Profile
View postgresql.conf
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
View benchmark.sql
This file has been truncated, but you can view the full file.
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
View -
. . 62: func read(db *sql.DB) {
. 4 63: rows, err := db.Query("SELECT name FROM users")
. . 64: if err != nil {
. . 65: log.Fatal(err)
. . 66: }
. . 67: defer rows.Close()
. . 68:
. . 69: users := []user{}
. 20 70: for rows.Next() {
. 3 71: user := user{}
View main.go
package main
import (
"database/sql"
"flag"
"log"
"time"
_ "github.com/lib/pq"
)
View main.go
// This services listens on log queue and saves log to database.
package main
import (
"log"
"time"
)
func main() {
jobChannel := make(chan (int))
View broker.go
package main
import (
"fmt"
kafka "github.com/Shopify/sarama"
zmq "github.com/pebbe/zmq4"
"os"
"os/signal"
"time"
)
View Vagrantfile
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu.13.10'
config.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-13.10_chef-provisionerless.box'
[3000, 3080, 3333, 4000, 8000, 8080].each do |port|
config.vm.network :forwarded_port, guest: port, host: port
end
config.ssh.forward_agent = true
View ssh-agent.zsh
if [ -z $SSH_AUTH_SOCK ];
then
eval `ssh-agent` > /dev/null
ssh-add ~/.ssh/id_rsa 2&> /dev/null
fi
View reverse.rb
#!/usr/bin/env ruby
def reverse(n, reversing = 0)
if n == 0
reversing
else
reverse(n / 10, n % 10 + reversing * 10)
end
end
View fib.rb
#!/usr/bin/env ruby
def fibgen
prev, curr = 0, 1
lambda do
temp = prev
prev = curr
curr += temp
temp
end