Skip to content

Instantly share code, notes, and snippets.

@saicologic
saicologic / Gemfile
Last active December 25, 2018 08:40
過去のesaの記事をまとめてArchiveする
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "esa"
@saicologic
saicologic / memusg
Created August 30, 2017 01:01 — forked from netj/memusg
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@saicologic
saicologic / dbdoc.rake
Last active August 31, 2015 02:18 — forked from ayasuda/dbdoc.rake
データベース定義書を作るタスク(rails用)
require 'rake'
Table = Struct.new(:name, :comment, :columns, :indexes)
Column = Struct.new(:name, :type, :not_null, :default, :primary_key, :comment)
Index = Struct.new(:name, :columns, :primary, :unique)
def get_schema_info(klass)
table = Table.new
table.name = klass.table_name
table.columns = []
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@saicologic
saicologic / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
require 'rake'
require 'rspec/core/rake_task'
require 'yaml'
require 'highline/import'
properties = YAML.load_file('properties.yaml')
ENV['SSH_USER'] = ask("Enter ssh user: ") { |q| q.echo = true }
ENV['SSH_PASSWORD'] = ask("Enter ssh password: ") { |q| q.echo = false }
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import sys
import os.path
import bz2
from gensim.corpora import WikiCorpus
from gensim.corpora.wikicorpus import filterWiki
@saicologic
saicologic / 00.md
Created March 20, 2014 08:34 — forked from hayajo/00.md
@saicologic
saicologic / test_timer.rb
Last active December 19, 2015 21:08
Ruby Timers Sample Program
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'timers'
timers = Timers.new
logs = []
logs << []
logs << []
@saicologic
saicologic / latency.txt
Created July 26, 2012 05:10 — forked from rtomayko/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
Read 1 MB sequentially from SSD 1,000,000 ns 1 ms 4X memory