Skip to content

Instantly share code, notes, and snippets.

View larry-fuy's full-sized avatar

Yong Fu larry-fuy

  • Seattle, WA, USA
View GitHub Profile
@larry-fuy
larry-fuy / [FEDORA] gitkraken
Created July 3, 2017 02:33 — forked from aelkz/[FEDORA] gitkraken
How to install gitkraken on Fedora 25 + launcher icon
#!/bin/bash
# Download GitKraken
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz
# copy the downloaded file into /opt directory
cp gitkraken-amd64.tar.gz /opt/gitkraken
cd /opt
@larry-fuy
larry-fuy / latency.txt
Created October 18, 2016 19:52 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@larry-fuy
larry-fuy / 0_reuse_code.js
Last active August 29, 2015 14:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@larry-fuy
larry-fuy / dagger-example.md
Last active November 27, 2017 17:49
Run dagger example #dagger

Maven

To run simple example, first build the project by Maven

mvn compile

then try to run the example by

java -cp target/classes/ coffee.CoffeeApp
@larry-fuy
larry-fuy / git_overview.md
Last active September 11, 2015 02:16
Git overview

Git workflow

Start a new project

  • git init
  • git clone

Update a project

@larry-fuy
larry-fuy / bash_error.sh
Created October 8, 2014 20:53
Bash output error message and exit
#!/bin/sh
# http://stackoverflow.com/questions/12700507/bash-proper-way-of-printing-out-an-error-message
error() {
echo "$@" 1>&2
}
fail() {
error "$@"
exit 1
}
@larry-fuy
larry-fuy / windows_update-manually
Created September 20, 2014 15:01
Windows update manually
1. Download the update files (*.msu)
2. Execute the commands ([Microsoft tech documents](http://support.microsoft.com/kb/934307))
```
expand -f:* "C:\*.msu" %TEMP%
pkgmgr.exe /n:%TEMP%\Windows6.0-KB934307-x86.xml
```