Skip to content

Instantly share code, notes, and snippets.

View fx-kirin's full-sized avatar
🌴
Somewhere on the planet.

fx-kirin fx-kirin

🌴
Somewhere on the planet.
View GitHub Profile
@nicoulaj
nicoulaj / build-zsh.sh
Created November 25, 2010 20:19
Build Zsh from sources on Ubuntu
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
git clone git://zsh.git.sf.net/gitroot/zsh/zsh
cd zsh

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@podhmo
podhmo / ctypes.example2.py
Created July 17, 2012 21:25
ctypes example . call qsort() with structure object (on python plane)
from ctypes import cdll
from ctypes import CFUNCTYPE, sizeof, POINTER, c_int
from ctypes import Structure
libc = cdll.LoadLibrary("libc.so.6")
import random
class Point(Structure):
_fields_ = [("x", c_int),
("y", c_int)]
@dropwhile
dropwhile / install-setup.txt
Last active February 28, 2020 05:43
python serialization speed comparison
virtualenv --no-site-packages hodor
hodor/bin/pip install simplejson ujson cbor tnetstring msgpack-python
curl -s 'http://www.json-generator.com/api/json/get/cvfsLVmKiG?indent=2' > test.json
hodor/bin/python shootout.py
@kevinold
kevinold / .ackrc
Created February 10, 2013 13:54 — forked from hernamesbarbara/.ackrc
#ack is a tool like grep, designed for programmers with large trees of heterogeneous source code
#to install ack, see http://betterthangrep.com/
#to use ack, launch terminal (mac osx) and type 'ack <some_keywords>'
#ack will search all files in the current directory & sub-directories
#here's how I have my config file setup. this file is located on mac osx here
# ~/.ackrc
# Always sort the files
(function() {
void(d = document);
void(el = d.getElementsByTagName('link'));
void(g = false);
void(count = 0);
for (i = 0; i < el.length; i++) {
if (el[i].getAttribute('rel').indexOf('alternate') != -1) {
if(count == 0) {
ty = el[i].getAttribute('type');
if(ty.indexOf('application/rss+xml') != -1 || ty.indexOf('text/xml') != -1) {
@markeganfuller
markeganfuller / disable_crontab_r
Created January 8, 2014 11:00
Disable crontab -r (remove)
# Disable crontab -r
function crontab ()
{
# Replace -r with -e
/usr/bin/crontab "${@/-r/-e}"
}
@dogrunjp
dogrunjp / update_hicharts
Created March 26, 2014 06:23
Highchartsのデータをアップデートする方法はdestroy()〜とredraw()の2種類ある。destroy()して再描画した方が若干速いらしい。いずれもD3.jsのアップデートよりわかりやすい。(普通にjQueryなので…) ※マルチデータなline chartの例
##destro()〜なアップデート
#chart = new Highcharts.Chart(options)がすでに描画されているケースでは
$.getJSON('hoge.json',function(data){
chart.destroy()
options.xAxis = data[1];
options.series = data[0]['datas'];
chart = new Highcharts.Chart(options);
});
##redraw()を利用したアップデート
@shawnrice
shawnrice / skeleton-daemon.sh
Created April 19, 2014 07:22
A template to write a quick daemon as a bash script
#!/bin/sh
# This is a skeleton of a bash daemon. To use for yourself, just set the
# daemonName variable and then enter in the commands to run in the doCommands
# function. Modify the variables just below to fit your preference.
daemonName="DAEMON-NAME"
pidDir="."
pidFile="$pidDir/$daemonName.pid"
@tsl0922
tsl0922 / .tmux.conf
Last active May 24, 2024 06:51
vim style tmux config
# vim style tmux config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."