Skip to content

Instantly share code, notes, and snippets.

View charlescui's full-sized avatar

CharlesCui charlescui

  • TvTaobao 电视淘宝 杭州智屏电子商务
  • China ZheJiang HangZhou
View GitHub Profile
// Copyright 2016 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// Command caption reads an audio file and outputs the transcript for it.
package main
import (
"io"
"log"
// Copyright 2016 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// Command caption reads an audio file and outputs the transcript for it.
package main
import (
"fmt"
"io"
@matsumotory
matsumotory / lua-bench
Last active January 21, 2016 18:32
ngx_mruby vs lua-nginx-module
$ /usr/local/apache/bin/ab -c 100 -n 100000 http://127.0.0.1/lua
Server Software: nginx/1.4.3
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /lua
Document Length: 13 bytes
Concurrency Level: 100
@willurd
willurd / web-servers.md
Last active May 3, 2025 05:35
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@charlescui
charlescui / wr703n-openwrt.md
Created September 5, 2012 23:21 — forked from ninehills/wr703n-openwrt.md
WR703N OpenWrt 配置流程

WR703N OpenWrt 配置流程

下载安装

访问WR703N在OpenWrt的[Wiki页][wr703n-openwrt],然后在Flashing一节中找到下载链接:[squashfs-factory.bin][flash.bin],下载后别忘了[比对md5][md5sum]。[1]

进入路由器管理界面,出厂配置为http://192.168.1.1,用户名和密码均为admin,然后进入固件更新,选择下载的文件,然后更新。

@joaopizani
joaopizani / .screenrc
Created May 17, 2012 11:55
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
@6ui11em
6ui11em / gist:2642954
Created May 9, 2012 08:27
jQuery: Fancybox dialog / alert
function fancyAlert(msg) {
jQuery.fancybox({
'modal' : true,
'content' : "<div style=\"margin:1px;width:240px;\">"+msg+"<div style=\"text-align:right;margin-top:10px;\"><input style=\"margin:3px;padding:0px;\" type=\"button\" onclick=\"jQuery.fancybox.close();\" value=\"Ok\"></div></div>"
});
}
function fancyConfirm(msg,callback) {
var ret;
jQuery.fancybox({
@tsabat
tsabat / zsh.md
Last active April 21, 2025 07:22
Getting oh-my-zsh to work in Ubuntu
@zumbojo
zumbojo / bijective.rb
Created July 9, 2011 22:09
Simple bijective function (base(n) encode/decode)
# Simple bijective function
# Basically encodes any integer into a base(n) string,
# where n is ALPHABET.length.
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047
ALPHABET =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//)
# make your own alphabet using:
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join
@Overbryd
Overbryd / rails_admin_without_devise.md
Created July 6, 2011 19:17 — forked from phoet/rails_admin_without_devise.rb
Using RailsAdmin without devise

Using rails_admin without devise

Having a buckload of code to authorize users on your application is something you may like or not. Speaking for myself I hate it. But I still love rails_admin, here's how you install it without devise. Thanks to phoet for providing the hints in the gist I have forked from.

Add RailsAdmin to your Gemfile

do NOT add devise

gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"