Skip to content

Instantly share code, notes, and snippets.

View yaodong's full-sized avatar

Yaodong Zhao yaodong

View GitHub Profile

From WikiPedia:

Apdex (Application Performance Index) is an open standard developed by an alliance of companies. It defines a standard method for reporting and comparing the performance of software applications in computing. Its purpose is to convert measurements into insights about user satisfaction, by specifying a uniform way to analyze and report on the degree to which measured performance meets user expectations.

The Apdex formula is the number of satisfied samples plus half of the tolerating samples plus none of the frustrated samples, divided by all the samples:

Apdext = (Satisfied Count + Tolerating Count / 2) / Total Samples

From Wikipedia:

In mathematics and computer science, a higher-order function (also functional form, functional or functor) is a function that does at least one of the following:

  • takes one or more functions as an input
  • outputs a function

Related to:

@yaodong
yaodong / Karabiner Settings
Last active August 29, 2015 14:18
Karabiner Settings
#!/bin/sh
cli=/Applications/Karabiner.app/Contents/Library/bin/karabiner
$cli set option.emacsmode_controlD 1
/bin/echo -n .
$cli set option.emacsmode_controlV 1
/bin/echo -n .
$cli set option.emacsmode_optionV 1
/bin/echo -n .
@yaodong
yaodong / gist:d41bf018e03fbba3e913
Created April 2, 2015 16:07
focus on page from address bar
on alfred_script(q)
tell application "Google Chrome"
set theURL to "javascript:"
set URL of active tab of window 1 to theURL
end tell
end alfred_script
@yaodong
yaodong / git-replace-email.sh
Created January 10, 2015 16:16
replace email in git history
#!/usr/bin/env bash
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ];
then
GIT_COMMITTER_NAME="YOUR NAME";
GIT_AUTHOR_NAME="YOUR NAME";
GIT_COMMITTER_EMAIL="[email protected]";
GIT_AUTHOR_EMAIL="[email protected]";
git commit-tree "$@";
@yaodong
yaodong / todo.sh
Created January 10, 2015 16:16
push todo from terminal to omnifocus
#! /usr/bin/osascript
on run arguments
if (count of arguments) > 0 then
tell application "OmniFocus"
tell default document
set result to make new inbox task with properties {name:arguments}
end tell
end tell
display notification "[+] " & arguments
@yaodong
yaodong / dropbox-control.sh
Created January 10, 2015 16:15
script for start, stop and restart dropbox
#!/usr/bin/env bash
case $1 in
start)
open -a dropbox;
;;
stop)
osascript -e 'tell application "dropbox" to quit'
;;
restart)
# Configuration file for dnsmasq.
#
# Format is one option per line, legal options are the same
# as the long options legal on the command line. See
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
# Listen on this specific port instead of the standard DNS port
# (53). Setting this to zero completely disables DNS function,
# leaving only DHCP and/or TFTP.
#port=5353
PREFIX="/usr/local"
RBENV_PREFIX="$PREFIX/rbenv"
BIN_PATH="$PREFIX/bin"
RBENV_GROUP="rbenv"
umask 002
## Install rbenv, ruby-build and rbenv-gem-rehash
git clone git://github.com/sstephenson/rbenv.git $RBENV_PREFIX
@yaodong
yaodong / nginx.conf
Created August 28, 2014 11:42
Unicorn config examples
# This is example contains the bare mininum to get nginx going with
# Unicorn or Rainbows! servers. Generally these configuration settings
# are applicable to other HTTP application servers (and not just Ruby
# ones), so if you have one working well for proxying another app
# server, feel free to continue using it.
#
# The only setting we feel strongly about is the fail_timeout=0
# directive in the "upstream" block. max_fails=0 also has the same
# effect as fail_timeout=0 for current versions of nginx and may be
# used in its place.