Skip to content

Instantly share code, notes, and snippets.

View gilbertwat's full-sized avatar

Gilbert Wat gilbertwat

View GitHub Profile
@gilbertwat
gilbertwat / package.json
Created November 28, 2014 11:31
Test Mongo
{
"name": "testmongo",
"version": "0.1.0",
"description": "test mongo speed",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT",
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href='http://fonts.googleapis.com/css?family=Indie+Flower' rel='stylesheet' type='text/css'>
<style>
html {
padding: 5mm;
background-color: #e9e9e9;
@gilbertwat
gilbertwat / setup.sh
Created June 23, 2013 08:06
workstation set up
apt-get update && apt-get upgrade
apt-get install vim git curl build-essential libssl-dev
#js
#java
#ruby just because web dev tools has a lot of tools in ruby
Verifying that +gilbertwat is my blockchain ID. https://onename.com/gilbertwat
@gilbertwat
gilbertwat / .gitconfig
Created April 26, 2017 01:24
.gitconfig
[alias]
d = diff
dc = diff --cached
ca = commit --amend
co = checkout
st = status
sp = stash pop
su = stash save -u
po = push origin
cm = commit -m
@gilbertwat
gilbertwat / .zshrc
Last active June 12, 2017 07:03
zsh rc
# Path to your oh-my-zsh installation.
export ZSH=/Users/gilbert/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
if [ -z $COLORTERM ]; then
ZSH_THEME="lambda"
else
### Keybase proof
I hereby claim:
* I am gilbertwat on github.
* I am gilbertwat (https://keybase.io/gilbertwat) on keybase.
* I have a public key ASD3a_S1JVXngq_gCrWIz3BIL2s1WIvsz1-tuCC39ZzGPAo
To claim this, I am signing this object:
@gilbertwat
gilbertwat / GGV_outage_template.md
Last active December 13, 2017 02:42
GGV_outage_template.md

Outage Report

Duration: (x)min
From: YYYYMMDDHHmm
To: YYYYMMDDHHmm
Summary: summary

Outage Timeline:

HHmm: Problem Found
HHmm: Ops screaming

@gilbertwat
gilbertwat / ggv_geekbot.rb
Created December 25, 2017 07:05
Geekbot API to CSV for easy analysis
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
require 'rubygems'
require 'json'
require 'csv'
after = 1509494400 #2017-11-01 00:00:00 +0800
user_id = 'JS Console Network Tab can help you'
@gilbertwat
gilbertwat / avoid_deadlock.rb
Created March 27, 2018 09:01
Avoid Deadlock
def must_deadlock
new_waypoints = get_new_waypoints
order.transaction do
order.waypoints.destroy_all
new_waypoints.each |waypoint| do
Order.waypoints.create!(waypoint)
end
end
end