Skip to content

Instantly share code, notes, and snippets.

View jollychang's full-sized avatar
🎼
Focusing

William Zhang jollychang

🎼
Focusing
View GitHub Profile
@jollychang
jollychang / getFileByName.gs
Created March 16, 2021 11:25
Google App Script funtions
//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 March 2, 2019 01:49
create vultr server by API
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'
{
"status": 0,
"encoding": "UTF-8",
"isdebug": false,
"vip": 0,
"isloop": 1,
"iscustom": false,
"data": [
{
"status": 1,
@jollychang
jollychang / postmortem.md
Created January 22, 2017 09:52 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@jollychang
jollychang / gist:585437a39fa78e0d6b7d1855a6c1d3a4
Created August 25, 2016 03:51 — forked from dcancel/gist:2345016
Facebook Engineering Bootcamp Links
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/
<!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 October 16, 2015 09:23
make -C infer
[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' \
@jollychang
jollychang / compile-fcp.sh
Created October 13, 2015 03:45
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
@jollychang
jollychang / log.txt
Created October 9, 2015 03:39
infer 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 August 29, 2015 14:26 — forked from rmcgibbo/github_comment_on_commit.py
Jenkins setup to automatically comment on github commits with build status
// 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'