Skip to content

Instantly share code, notes, and snippets.

Avatar
🎼
Focusing

William Zhang jollychang

🎼
Focusing
View GitHub Profile
@jollychang
jollychang / getFileByName.gs
Created Mar 16, 2021
Google App Script funtions
View getFileByName.gs
//https://yagisanatode.com/2018/10/05/google-apps-script-get-file-by-name-with-optional-parent-folder-crosscheck/
function getFileByName(fileName, fileInFolder){
var filecount = 0;
var dupFileArray = [];
var folderID = "";
var files = DriveApp.getFilesByName(fileName);
while(files.hasNext()){
@jollychang
jollychang / create_vultr_server.sh
Created Mar 2, 2019
create vultr server by API
View create_vultr_server.sh
curl -H 'API-Key: YOUR_VULTR_TOKEN' https://api.vultr.com/v1/server/create --data 'DCID=25' --data 'VPSPLANID=201' --data 'OSID=215'
curl -H 'API-Key: YOUR_VULTR_TOKEN' https://api.vultr.com/v1/server/create --data 'DCID=40' --data 'VPSPLANID=201' --data 'OSID=215’
curl -H 'API-Key: YOUR_VULTR_TOKEN' https://api.vultr.com/v1/server/create --data 'DCID=6' --data 'VPSPLANID=199' --data 'OSID=215'
View img_list.json
{
"status": 0,
"encoding": "UTF-8",
"isdebug": false,
"vip": 0,
"isloop": 1,
"iscustom": false,
"data": [
{
"status": 1,
@jollychang
jollychang / postmortem.md
Created Jan 22, 2017 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491
View postmortem.md

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@jollychang
jollychang / gist:585437a39fa78e0d6b7d1855a6c1d3a4
Created Aug 25, 2016 — forked from dcancel/gist:2345016
Facebook Engineering Bootcamp Links
View gist:585437a39fa78e0d6b7d1855a6c1d3a4
https://www.facebook.com/notes/facebook-engineering/facebook-engineering-bootcamp/177577963919
https://www.facebook.com/notes/facebook-engineering/bootcamp-growing-culture-at-facebook/249415563919
http://www.quora.com/How-does-Facebook-Engineerings-Bootcamp-program-work
http://thenextweb.com/facebook/2011/10/11/revealed-details-of-bootcamp-all-new-facebook-engineers-complete-video/
View ios-8-web-app.html
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@jollychang
jollychang / log
Created Oct 16, 2015
make -C infer
View log
[jollychang@jollychangs-MBP infer]$ make -C infer
make -C src clang
GIT_COMMIT=$(git rev-parse HEAD 2> /dev/null || printf "unknown commit"); \
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null || printf "unknown branch"); \
UNKNOWN="-unknown"; \
if [ -e "/Users/jollychang/works/infer/.release" ]; then \
UNKNOWN=""; \
fi; \
GIT_TAG=$(git tag --points-at HEAD 2> /dev/null || printf "v0.4.0$UNKNOWN"); \
sed -e 's/@MAJOR@/0/g' \
View compile-fcp.sh
[jollychang@jollychangs-MBP infer]$ ./compile-fcp.sh
+++ dirname ./compile-fcp.sh
++ cd .
++ pwd
+ INFER_ROOT=/Users/jollychang/works/infer
+ PLUGIN_DIR=/Users/jollychang/works/infer/facebook-clang-plugins
+ CLANG_EXEC=/Users/jollychang/works/infer/facebook-clang-plugins/clang/bin/clang
+ '[' '!' -f /Users/jollychang/works/infer/facebook-clang-plugins/clang/bin/clang ']'
+ pushd /Users/jollychang/works/infer/facebook-clang-plugins
~/works/infer/facebook-clang-plugins ~/works/infer
View log.txt
make -C src clang
sed -e 's/@MAJOR@/0/g' \
-e 's/@MINOR@/2/g' \
-e 's/@PATCH@/0/g' \
-e 's/@GIT_COMMIT@/37a4709a0f2be7b23a29950a2d6345040b67b8eb/g' \
-e 's/@GIT_BRANCH@/master/g' \
-e 's/@GIT_TAG@/v0.3.0/g' \
backend/version.ml.in > backend/version.ml
atdgen -t backend/jsonbug.atd -o backend/jsonbug
atdgen -j backend/jsonbug.atd -o backend/jsonbug
@jollychang
jollychang / github_comment_on_commit.py
Last active Aug 29, 2015 — forked from rmcgibbo/github_comment_on_commit.py
Jenkins setup to automatically comment on github commits with build status
View github_comment_on_commit.py
// Using the Jenkins Groovy Post build plugin to execute the following after every build
// https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin
// It would be nice not to have to specify these here... the repo name should be available within the hudson
// api somehow, but I didn't know how to get it. The access token should maybe be saved in a config file, and
// read in at runtime?
GITHUB_REPO_NAME = 'myusername/myreponame'
GITHUB_ACCESS_TOKEN = 'my_github_api_v3_access_token'