Skip to content

Instantly share code, notes, and snippets.

@hardywu
hardywu / post.rb
Last active December 19, 2015 05:58
A rails model for gollum-lib, which is used to embed `gollum` into existing rails project. The `unindexable` and `unreadable` statuses are introduced. The `pull` and `push` method is added to have the git repository sync with its **remote origin**.
class Post
@data = Gollum::Wiki.new('doc/blog.git', :mathjax => true)
@@unindexable = 'page'
@@unreadable = 'pending'
def self.data
@data
end
def self.reload
@hardywu
hardywu / config.ru
Created July 5, 2013 10:58
config.ru script to set up a personal wiki on './public'
#!/usr/bin/env ruby
require 'rubygems'
require 'gollum/app'
# disable :run
# configure :development, :staging, :production do
# set :raise_errors, true
@hardywu
hardywu / pngout.rb
Created July 14, 2013 00:15
homebrew formula for the pngout of 20130221. Fork from https://bitbucket.org/socradev/homebrew-alt
require 'formula'
class Pngout < Formula
url 'http://static.jonof.id.au/dl/kenutils/pngout-20130221-darwin.tar.gz'
homepage 'http://www.jonof.id.au/kenutils'
md5 '2f35b7369d5ab668cea414772de6fba9'
version '20130221'
def install
bin.install 'pngout'
#################################
#
# 本清单基于 ubuntu 12.04,
# 下个 ubuntu 的 LTS
# 发出来后,会相应更新这里的内容。我的目标是按步执行可以零错误完成安装。
# 注意,本文件只是一个清单,不是一个可以安全执行的脚本
#
#################################
# create a linode,login as root, and create a common user for all the tasks
@hardywu
hardywu / loudspeaker.md
Last active December 28, 2015 04:39
A temp translation for my friend

An introduction to the physics of the loudspeaker

  1. a few concepts about the sound Sound is a sequence of waves of pressure that propagates through compressible media such as air or water. People hear the sound when it reaches their ears. Without the media to propagate the waves, there would be no sound.

  2. Three physical quantities of the waves.

    1. Amplitude(A): The amplitude of the wave
  3. Frequency(F): The number of oscillations per unit time (the frequency range that human can hear is 20-200000Hz)

inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
RangeInput
StringInput
TextInput
% These are examples of Feynman Diagrams using TikZ
% Author: Flip Tanedo, 2010. pt267@cornell.edu
\documentclass[12pt]{article} % Why do I use such a boring document clas?
% THE USUAL PACKAGES
\usepackage{amsmath,amssymb,amsfonts} % DON'T use cite, screws with bibtex + hyperref
\usepackage{color}
\usepackage{amsmath}
\usepackage{amsfonts}
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
sudo dpkg -i elasticsearch-1.0.1.deb
@hardywu
hardywu / gist:10758513
Created April 15, 2014 18:49
Cal-Am241.asc
Apr 14 2013 01:42:20 am Elt: 00703 Seconds
ID: No spectrum identifier defined
Memory Size: 1024 Chls Conversion Gain: 1024 Adc Offset: 0000 Chls
Chn Counts ROI
0, 0 000
1, 0 000
2, 0 000
3, 0 000
4, 0 000

Apr 16 2013 01:32:21 am Elt: 01000 Seconds ID: No spectrum identifier defined Memory Size: 1024 Chls Conversion Gain: 1024 Adc Offset: 0000 Chls

Chn    Counts  ROI
  0,        0  000
  1,        0  000
  2,        0  000
  3,        0  000
  4,        0  000