Skip to content

Instantly share code, notes, and snippets.

View yaodong's full-sized avatar

Yaodong Zhao yaodong

View GitHub Profile
@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" = "from@example.com" ];
then
GIT_COMMITTER_NAME="YOUR NAME";
GIT_AUTHOR_NAME="YOUR NAME";
GIT_COMMITTER_EMAIL="to@example.com";
GIT_AUTHOR_EMAIL="to@example.com";
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.

From WikiPedia:

A parity bit, or check bit is a bit added to the end of a string of binary code that indicates whether the number of bits in the string with the value one is even or odd. Parity bits are used as the simplest form of error detecting code.

There are two variants of parity bits: even parity bit and odd parity bit.

In the case of even parity, the number of bits whose value is 1 in a given set are counted. If that total is odd, the parity bit value is set to 1, making the total count of 1's in the set an even number. If the count of ones in a given set of bits is already even, the parity bit's value remains 0.