Skip to content

Instantly share code, notes, and snippets.

@ericzon
ericzon / NewLibrary.raml
Created April 6, 2017 09:16
RAML pet shop test
#%RAML 1.0 Library
traits:
FilterableByPrice:
queryParameters:
priceLessThen?:
type: number
priceMoreThen?:
type: number
resourceTypes:
@dzlab
dzlab / build.sh
Last active October 28, 2025 11:55
Configure NGINX to log HTTP POST request's body
#!/bin/bash
echo "Building NGINX along with Echo module"
# install prerequisites
yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel
# download the Echo module
curl -L -O 'https://github.com/openresty/echo-nginx-module/archive/v0.58.tar.gz'
tar -xzvf v0.58.tar.gz && rm v0.58.tar.gz
mv echo-nginx-module-0.58 /tmp/echo-nginx-module
@seayxu
seayxu / CSharp-WinForm-Show-Console
Last active January 4, 2018 01:04
Show console in csharp winform func
namespace Demo
{
static class Program
{
[DllImport("kernel32.dll")]
static extern bool FreeConsole();//Call Sysytem API,Disposed Console
[DllImport("kernel32.dll")]
public static extern bool AllocConsole();//Call Sysytem API,Show Console
[STAThread]
@Jimmy-Xu
Jimmy-Xu / shadowsocks_privoxy_tsocks.md
Last active April 29, 2022 15:00
shadowsocks+privoxy/tsocks

shadowsocks + privoxy/tsocks

  • shadowsocks: service, socks proxy
  • privoxy: service, convert socks proxy to http proxy
  • tsocks: tool, use socks proxy for any command line

Usage

tested under ubuntu14.04

@kastnerkyle
kastnerkyle / audio_tools.py
Last active November 17, 2024 12:01
Audio tools for numpy/python. Constant work in progress.
raise ValueError("DEPRECATED/FROZEN - see https://github.com/kastnerkyle/tools for the latest")
# License: BSD 3-clause
# Authors: Kyle Kastner
# Harvest, Cheaptrick, D4C, WORLD routines based on MATLAB code from M. Morise
# http://ml.cs.yamanashi.ac.jp/world/english/
# MGC code based on r9y9 (Ryuichi Yamamoto) MelGeneralizedCepstrums.jl
# Pieces also adapted from SPTK
from __future__ import division
import numpy as np
@soheilpro
soheilpro / example.sh
Last active July 17, 2025 23:50
Easy IIS log file format specification for goaccess.
goaccess -f u_ex150629.log --log-format "$(cat u_ex150629.log | ./goiisformat.sh)" --date-format '%Y-%m-%d' --time-format '%H:%M:%S'
@neuro-sys
neuro-sys / fix.md
Last active April 14, 2018 19:35
How to Fix PhantomJS to work with GhostDriver

Copy paste the line below to your terminal:

https://gist.githubusercontent.com/neuro-sys/3bf00b6cf28a93e07e44/raw/e8976da93a55e5ef7c5e8dc99c00772fffb06f6c/replacestring.c
gcc replacestring.c -oreplacestring
./replacestring "$(strings /usr/bin/phantomjs | grep "platform: ghostdriver")" " " < /usr/bin/phantomjs > phantomjs && chmod a+x phantomjs
sudo cp phantomjs /usr/bin/phantomjs

Alright, there's a bug in a recent version of PhantomJS which renders it unable to run with GhostDriver. The error is like this:

@neocodegs
neocodegs / gist:df81bcf2047d917f9ad7
Created December 16, 2014 06:45
Fiddler script hide css,js,font
public static RulesOption("Hide CSS")
BindPref("fiddlerscript.rules.HideCSS")
var m_HideCSS: boolean = true;
public static RulesOption("Hide JavaScript")
BindPref("fiddlerscript.rules.HideJavaScript")
var m_HideJavascript: boolean = true;
public static RulesOption("Hide Font")
@dalegaspi
dalegaspi / python27_on_centos65.md
Last active September 9, 2021 05:29
Installing Python 2.7 on CentOS 6.5

Installing Python 2.7 on Centos 6.5

Centos 6.* comes with Python 2.6, but we can't just replace it with v2.7 because it's used by the OS internally (apparently) so you will need to install v2.7 (or 3.x, for that matter) along with it. Fortunately, CentOS made this quite painless with their Software Collections Repository

sudo yum update # update yum
sudo yum install centos-release-scl # install SCL 
sudo yum install python27 # install Python 2.7

To use it, you essentially spawn another shell (or script) while enabling the newer version of Python:

@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active February 15, 2026 20:33
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook