Skip to content

Instantly share code, notes, and snippets.

View yaodong's full-sized avatar

Yaodong Zhao yaodong

View GitHub Profile
@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)
@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 / 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 / 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 / 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 .

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:

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 stackoverflow:

Marketing hype (and cost). This is not part of the spec.

From Wikipedia:

VeriSign uses the concept of classes for different types of digital certificates :

  • Class 1 for individuals, intended for email.
  • Class 2 for organizations, for which proof of identity is required.

From stackoverflow:

Marketing hype (and cost). This is not part of the spec.

From Wikipedia:

VeriSign uses the concept of classes for different types of digital certificates :

  • Class 1 for individuals, intended for email.
  • Class 2 for organizations, for which proof of identity is required.