Skip to content

Instantly share code, notes, and snippets.

View flavius's full-sized avatar

Flavius Aspra flavius

View GitHub Profile
@duellsy
duellsy / gulpfile.js
Created February 20, 2014 23:52
Laravel auto testing gulp
var gulp = require('gulp');
var sass = require('gulp-sass');
var minifycss = require('gulp-minify-css');
var autoprefixer = require('gulp-autoprefixer');
var phpunit = require('gulp-phpunit');
var notify = require('gulp-notify');
var gutil = require('gulp-util');
var exec = require('child_process').exec;
var sys = require('sys');
var livereload = require('gulp-livereload');
@baoilleach
baoilleach / longestpath.py
Created November 24, 2013 17:54
How to find the longest path in a directed acyclic graph
from collections import defaultdict
def toposort(graph):
"""http://code.activestate.com/recipes/578272-topological-sort/
Dependencies are expressed as a dictionary whose keys are items
and whose values are a set of dependent items. Output is a list of
sets in topological order. The first set consists of items with no
dependences, each subsequent set consists of items that depend upon
items in the preceeding sets.
@rdlowrey
rdlowrey / libevent.md
Last active March 28, 2016 06:24
libevent aerys benchmarks

100k Requests -- 100 concurrent clients

ab -n 100000 -c 100 -k http://127.0.0.1:1337/

Server Software:        
Server Hostname:        127.0.0.1
Server Port:            1337

Document Path:          /
@rcoup
rcoup / rsync_parallel.sh
Created April 10, 2013 21:52
Parallel-ise an rsync transfer when you want multiple concurrent transfers happening,
#!/bin/bash
set -e
# Usage:
# rsync_parallel.sh [--parallel=N] [rsync args...]
#
# Options:
# --parallel=N Use N parallel processes for transfer. Defaults to 10.
#
# Notes:
@dannvix
dannvix / nginx-non-transparent-ssl-proxy.md
Last active October 16, 2023 19:07
Guide to set up nginx as non-transparent SSL proxy, which subsitutes strings in the server responses

Use nginx as Non-Transparent SSL Proxy

Introduction

Many mobile apps have back-end API servers. They usually rely on the API replies to determine whether certain information is supposed to be shown. If the API responses could be manipulated on the fly, we may easily fool an unmodified app to expose some private data.

This manual guides you to set up nginx as non-transparent SSL proxy, which just subsitutes strings in the server responses (i.e. man-in-the-middle attack ourself). For both server-side (their API servers) and client-side (your device), the whole process is almost transparent.

@jshaw
jshaw / byobuCommands
Last active April 25, 2025 06:20
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
" HJKL repetition trap
" Barry Arthur, 2013-03-14
" depends on your :help 'updatetime setting
let g:cursor_moving = 0
function! TrapMovementKeys(key)
augroup CursorMoving
au!
autocmd CursorMoved * let g:cursor_moving = 1
@tiziano88
tiziano88 / gist:5166177
Last active December 14, 2015 23:29
Sane tmux session management for zsh with dynamic session name autocompletion.
function mux {
case "$1" in
"")
# If no args, list all the available "visible" sessions.
tmux ls | grep --color=never -C0 "^[^.]"
;;
*)
# "Hidden" sessions have a name starting with a '.'.
session_id=".$1.`date +%Y%m%d%H%M%S`"
# Try to create a hidden session and attach it to the specified one, killing it once finished.
@dahu
dahu / gist:5160260
Created March 14, 2013 10:18
HJKL repetition trap for Vim
" HJKL repetition trap
" Barry Arthur, 2013-03-14
" depends on your :help 'updatetime setting
let g:cursor_moving = 0
function! TrapMovementKeys(key)
augroup CursorMoving
au!
autocmd CursorMoved * let g:cursor_moving = 1
@oaass
oaass / gist:4577325
Last active December 11, 2015 08:59
<?php
$required = array('hostname', 'username', 'password', 'database', 'driver');
$config = array(
'password' => 'pass',
'database' => 'mydb',
'charset' => 'utf8',
'port' => '1234'
);
$errors = array_diff($required, array_flip($config));