This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g default-terminal "xterm-256color" | |
set -g prefix M-f | |
unbind C-b | |
bind M-f send-prefix | |
bind -n M-` last-window | |
bind -n M-1 select-window -t :=1 | |
bind -n M-2 select-window -t :=2 | |
bind -n M-3 select-window -t :=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <pthread.h> | |
#include <semaphore.h> | |
pthread_t t1, t2; | |
sem_t sem_start1, sem_start2, sem_end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <arpa/inet.h> | |
typedef int v4si __attribute__ ((vector_size (16))); | |
// /8 /10 /12 /16 | |
const v4si mask = {0x000000FF, 0x0000C0FF, 0x0000F0FF, 0x0000FFFF}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.math.BigInteger; | |
import java.nio.charset.StandardCharsets; | |
import java.security.InvalidKeyException; | |
import java.security.Key; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.spec.InvalidKeySpecException; | |
import javax.crypto.BadPaddingException; | |
import javax.crypto.Cipher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pid /run/nginx/nginx.pid; | |
lock_file /run/nginx/nginx.lock; | |
error_log /opt/logs/nginx/error.log error; | |
pcre_jit on | |
worker_processes 4; | |
worker_priority -10; | |
events { | |
worker_connections 4096; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- lua-zlib is required | |
local MAX_BODY_SIZE = 16777216 | |
ngx.ctx.max_chunk_size = tonumber(ngx.var.max_chunk_size) or 262144 -- 256KB | |
ngx.ctx.max_body_size = tonumber(ngx.var.max_body_size) or MAX_BODY_SIZE -- 16MB | |
function bad_request_response(status, msg) | |
local message = string.format('{"status": %d, "msg": "%s"}', status, msg) | |
ngx.status = ngx.HTTP_BAD_REQUEST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# .ipa path: /tmp/packapp/com.xxx.${sub_domain}/build/com.xxx.${sub_domain}.app.ipa | |
# required progs: | |
# wget; | |
# python2.7 ./substitute.py; | |
# lockfile; | |
# imagemagick(convert, identify); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2.7 | |
import sys | |
import string | |
_usage = """ | |
Please redirect stdin to the input file, redirect stdout to the output file. | |
./subtitute.py ARG1=XXX ARG2=YYY < path_to_input > path_to_output\n | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r"""Command-line tool to validate and pretty-print JSON | |
Usage:: | |
$ echo '{"json":"obj"}' | python -m json.tool | |
{ | |
"json": "obj" | |
} | |
$ echo '{ 1.2:3.4}' | python -m json.tool | |
Expecting property name: line 1 column 2 (char 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; A Church-Numberal is a function, which takes a function f(x) | |
;; as its argument and returns a new function f'(x). | |
;; Church-Numerals N applies the function f(x) N times on x. | |
; predefined Church-Numerals 0 to 9 | |
(define zero (lambda (f) (lambda (x) x))) | |
(define one (lambda (f) (lambda (x) (f x)))) | |
(define two (lambda (f) (lambda (x) (f (f x))))) | |
(define three (lambda (f) (lambda (x) (f (f (f x)))))) | |
(define four (lambda (f) (lambda (x) (f (f (f (f x))))))) |
NewerOlder