Skip to content

Instantly share code, notes, and snippets.

View Congee's full-sized avatar
🤔
Focus

Changsheng Wu Congee

🤔
Focus
View GitHub Profile

Hmmmm, you may have noticed that DigitalOcean provides one-step ghost blog setup -- you can directly choose Ghost 0.4.2 on Ubuntu 12.04. But, as you see, it's 12.04 which may does'nt meet our needs.
E.g. its vim version is 7.3, compiled in 2011.

So, you may think: I should customize all by myself, and certainly I can make it. Then, you would have installed everything needed. As you cd ghost && npm start, only to find :

/usr/bin/env: node: No such file or directory
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
@Congee
Congee / ag-peco
Created February 23, 2015 10:50
Ag as a peco matcher
#!/bin/sh
while read LINE; do
if [[ -f "${LINE}" ]] &&\
[[ -r "${LINE}" ]] &&\
[[ $(ag -l "$1" "${LINE}") ]]; then
echo "${LINE}"
fi
done
@Congee
Congee / pinyin-grep
Created February 23, 2015 10:12
支持拼音首字母检索
#!/usr/bin/env python3
# encoding: utf-8
import pinyin
import sys
import re
query = sys.argv[1]
pattern = re.compile(query)
for line in sys.stdin:
require 'formula'
class Unzip < Formula
homepage 'http://www.info-zip.org/pub/infozip/UnZip.html'
url 'https://downloads.sourceforge.net/project/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz'
version '6.0'
sha1 'abf7de8a4018a983590ed6f5cbd990d4740f8a22'
keg_only :provided_by_osx
--- a/unix/Makefile 2015-02-12 22:17:02.000000000 +0800
+++ b/unix/Makefile 2015-02-12 22:17:16.000000000 +0800
@@ -872,7 +872,7 @@
# Macintosh MacOS X (Unix-compatible enviroment), using standard compiler
macosx: unix_make
- $(MAKE) unzips CFLAGS="-O3 -Wall -DBSD" LF2=""
+ $(MAKE) unzips CFLAGS="-O3 -Wall -DBSD" LF2="-liconv"
$(STRIP) $(UNZIPS)
@Congee
Congee / nyancat.rb
Created January 28, 2015 05:57
nyancat_homebrew_formula
class Nyancat < Formula
homepage "http://nyancat.dakko.us/"
version "HEAD"
url "https://github.com/klange/nyancat.git"
def install
system "make"
bin.install "src/nyancat"
man1.install "nyancat.1"
end
@Congee
Congee / pycdc.rb
Created January 28, 2015 05:57
pycdc_homebrew_formula
class Pycdc < Formula
homepage "https://github.com/zrax/pycdc"
url "https://github.com/zrax/pycdc.git"
version "HEAD"
depends_on "cmake" => :build
def install
system "cmake", "."
system "make"
@Congee
Congee / libsvm.rb
Created November 6, 2014 13:02
libsvm for homebrew with python bindings
require 'formula'
class Libsvm < Formula
homepage 'http://www.csie.ntu.edu.tw/~cjlin/libsvm/'
url 'http://www.csie.ntu.edu.tw/~cjlin/libsvm/oldfiles/libsvm-3.18.tar.gz'
sha1 '20bd3e2d21d79c3714007043475b92dfeed29135'
bottle do
cellar :any
revision 1
@Congee
Congee / tsunami-udp.rb
Created October 19, 2014 12:08
tsunami-udp in Homebrew
require "formula"
class TsunamiUdp < Formula
homepage "http://tsunami-udp.sourceforge.net/"
url "http://superb-dca2.dl.sourceforge.net/project/tsunami-udp/tsunami-udp/tsunami-v1.1-cvsbuild42/tsunami-v1.1-cvsbuild42.tar.gz"
sha1 "e16ae011ad2e953e493c916da4b51a4cdc3425e2"
depends_on "autoconf" => :build
depends_on "automake" => :build
require "formula"
class Nbtscan < Formula
homepage "http://www.inetcat.net/software/nbtscan.html"
url "http://distcache.freebsd.org/ports-distfiles/nbtscan-1.5.1.tar.gz"
mirror "http://www.sourcefiles.org/Networking/Tools/Miscellanenous/nbtscan-1.5.1.tar.gz"
sha1 "4041d8f6b592fa310b8d3c79c56a2d3263dba82f"
patch :p1 do
url "https://gist.githubusercontent.com/congee/76693bd4b61b862b2333/raw/341b46d867120dc9b3e89a23b49f17e82be39d58/debian-patches-04_fix_compiler_warnings.diff"