Skip to content

Instantly share code, notes, and snippets.

Stone Gao stonegao

Block or report user

Report or block stonegao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
stonegao / change_mac_address
Created Nov 27, 2019 — forked from ckoepp/change_mac_address
A small bash script to change a mac address - includes one line of Python to generate random numbers.
View change_mac_address
# The MIT License (MIT)
# Copyright (c) 2014 Christian Koepp <>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
stonegao /
Created Aug 22, 2019 — forked from subfuzion/
Concise guide to golang/dep


This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

stonegao / go-tour-select.go
Created Aug 21, 2019 — forked from t9md/go-tour-select.go
Go's Channel and select {} illustrated
View go-tour-select.go
package main
Channel and select {} illustrated by t9md
sample program to understand goroutine communication via channel.
based on go-tour's example
stonegao / main.go
Created Jul 28, 2019 — forked from julz/main.go
containersched minicontainer
View main.go
package main
import (
func main() {
View Attacking Ruby on Rails Applications
==Phrack Inc.==
Volume 0x0f, Issue 0x45, Phile #0x0c of 0x10
|=--------------=[ Attacking Ruby on Rails Applications ]=---------------=|
|=---------------------=[ joernchen of Phenoelit ]=----------------------=|
|=---------------------=[ ]=----------------------=|
stonegao / rails-jsonb-queries
Created Apr 22, 2019 — forked from mankind/rails-jsonb-queries
Rails-5 postgresql-9.6 jsonb queries
View rails-jsonb-queries
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
stonegao /
Created Apr 19, 2019 — forked from Integ/
A useful tool for unpack wxapkg file with python3 surport.
# coding: utf-8
# py2 origin author lrdcq
# usage python3 filename
__author__ = 'Integ:'
import sys, os
import struct
class WxapkgFile(object):
stonegao /
Created Feb 28, 2019 — forked from shobotch/
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN
Consumer key:    IQKbtAYlXLripLGPWd0HUA
stonegao /
Created Jan 21, 2019 — forked from XVilka/
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
You can’t perform that action at this time.