Skip to content

Instantly share code, notes, and snippets.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

# https://ruby-china.org/topics/7555
# gem 'fast_trie', :require => "trie"
# encoding: utf-8
class SegTrie
attr_accessor :trie
def initialize
self.trie = ::Trie.new
end
@c93614
c93614 / regexp-trie.py
Last active August 29, 2015 14:12 — forked from fcicq/regexp-trie.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#author: rex
#blog: http://iregex.org
#filename tr.py
#created: 2010-08-01 20:24
#source uri: http://iregex.org/blog/trie-in-python.html
# escape bug fix by fcicq @ 2012.8.19
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#author: rex
#blog: http://iregex.org
#filename tr.py
#created: 2010-08-01 20:24
#source uri: http://iregex.org/blog/trie-in-python.html
# escape bug fix by fcicq @ 2012.8.19
<?php
$posting = $database->postlist_begin( $search_id );
$enquire = new XapianEnquire( $database );
$rset = new XapianRset();
$rset->add_document( $posting->get_docid() );
$eset = $enquire->get_eset(20, $rset);
$i = $eset->begin();
$terms = array();
# EDIT: 2013/10/20
# google has updated its kwt UI, this script doesn't work any more!
# may be I will update this script when I have time to investigate their new Interface.
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
import selenium.webdriver.support.wait
selenium.webdriver.support.wait.POLL_FREQUENCY = 0.05
import re
@c93614
c93614 / ugly.js
Last active August 29, 2015 14:21 — forked from cuber/ugly.js
var Searcher = {
a: function() {
so = this;
so.g();
window._r_ = false;
window.google = {
td: function(a, b, c) {
if (window._r_) return;
var h = c.d;
var t = h.match(/<font size="-1">[^,\d]*([,\d]+)[^,\d]*[^\d]*(\d+)[^\d]* <b>(.*?)<\/b> &nbsp;<\/font>/);
@c93614
c93614 / shell.sh
Last active November 10, 2019 10:50
curl to create paste on pastebe.com
echo "hello world" | curl -s -F 'api_dev_key=f058f68ae36897f3f15fcccba445d551' -F 'api_option=paste' -F 'api_paste_code=<-' http://pastebin.com/api/api_post.php
# https://clbin.com/
@c93614
c93614 / port_forward.go
Last active October 15, 2015 09:51
Simple connection fowarder in golang
// http://blog.evilissimo.net/simple-port-fowarder-in-golang
package main
import (
"io"
"log"
"net"
"os"
)
@c93614
c93614 / 100_base.conf
Created November 5, 2015 10:12 — forked from danackerson/100_base.conf
using nginx + lua + redis for redirects and rewrites
# using such a setup requires `apt-get install lua-nginx-redis` under Ubuntu Trusty
# more info @ http://wiki.nginx.org/HttpLuaModule#access_by_lua
http {
lua_package_path "/etc/nginx/include.d/?.lua;;";
lua_socket_pool_size 100;
lua_socket_connect_timeout 10ms;
lua_socket_read_timeout 10ms;
server {