Skip to content

Instantly share code, notes, and snippets.

Steven Lu sjlu

Block or report user

Report or block sjlu

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
View signature.txt
<div dir="ltr"><table class="gmail-bravado-signature" style="font-family:Montserrat,sans-serif;color:rgb(0,0,0);line-height:1.5;font-size:14px;box-sizing:border-box;width:288px"><tbody style="font-family:Roboto,sans-serif;color:inherit;line-height:1.5;box-sizing:border-box"><tr style="color:inherit;line-height:1.5;box-sizing:border-box"><td style="font-family:Roboto,sans-serif;color:inherit;line-height:1.5;box-sizing:border-box;width:48px"><a href="https://bravado.co/p/stevenlu" style="color:inherit;line-height:1.5;box-sizing:border-box"><div width="48" height="48" style="color:inherit;line-height:1.5;box-sizing:border-box;width:48px;height:48px;border-radius:50%;overflow:hidden"><img width="48" src="https://d2pnpqlbobcs6g.cloudfront.net/users/avatars/000/000/807/thumb/0?1547471862" style="color: inherit; line-height: 1.5; box-sizing: border-box; width: 48px;"></div></a></td><td style="font-family:Roboto,sans-serif;color:inherit;line-height:1.5;box-sizing:border-box;padding-left:16px"><div style="color:inheri
@sjlu
sjlu / Contentful.js
Last active Jun 3, 2019
This helps compile Jekyll posts from Contentful
View Contentful.js
var Promise = require('bluebird')
var _ = require('lodash')
var fs = require('fs')
var contentful = require('contentful')
var client = contentful.createClient({
space: '0eybfmw2qkbf',
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
host: process.env.CONTENTFUL_HOST
})
@sjlu
sjlu / metabase
Created Mar 15, 2018
metabase init.d
View metabase
#!/bin/sh
# /etc/init.d/metabase
### BEGIN INIT INFO
# Provides: Metabase
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Metabase analytics and intelligence platform
### END INIT INFO
View gist:04011be67ab40a086d52be16edeacc2c
%23%20Please%20set%20the%20following%20variables%20inside%0A%23%20this%20varnish%20config%20or%20through%20the%20Fastly%0A%23%20control%20panel%0A%23%0A%23%20backend%20F_aws_bucket%0A%23%20backend%20F_api%0A%0Asub%20vcl_recv%20%7B%0A%23FASTLY%20recv%0A%0A%20%20%23%20redirect%20any%20crawlers%20directly%20to%20the%20Ruby%20API%0A%20%20%23%20so%20that%20we%20can%20serve%20metatags%20to%20them%0A%20%20if%20(req.url%20~%20%22_escaped_fragment_%22%20%7C%7C%20req.http.user-agent%20~%20%22baiduspider%7Ctwitterbot%7Cfacebookexternalhit%7Crogerbot%7Clinkedinbot%7Cembedly%7Cquora%20link%20preview%7Cshowyoubot%7Coutbrain%7Cpinterest%7Cslackbot%7CvkShare%7CW3C_Validator%7Credditbot%7CSlackbot-LinkExpanding%22)%20%7B%0A%20%20%20%20set%20req.backend%20%3D%20F_api%3B%0A%20%20%20%20%23%20set%20req.http.Host%20%3D%20F_api.host%3B%0A%20%20%20%20set%20req.http.X-Crawler%20%3D%20%22yes%22%3B%0A%20%20%7D%0A%0A%20%20%23%20enforce%20APEX%20domains%20to%20direct%20to%20%22www.%22%20instead%0A%20%20%23%20if%20not%20already%20%22www.%
View gist:efa7152fc13219bf01d357e195e3acaf
return request({
method: 'POST',
url: 'https://api.fastly.com/service/' + main.SERVICE_ID + '/version/' + this.number + '/vcl',
headers: {
'Fastly-Key': main.API_KEY
},
form: {
name: 'gulp-fastly-uploaded-vcl',
file: encodeURIComponent(String(file.contents))
}
View gist:ca9891ad27cb2075a8bef777ec03e47a
func resetAndChooseView() {
window?.rootViewController = nil
if (AuthRepository.sharedInstance.isLoggedIn()) {
showCameraView()
} else {
showLoginView()
}
}
@sjlu
sjlu / notes.md
Created Oct 19, 2015
CircleCI with automated Docker builds
View notes.md

CircleCI Docker Integration

Grab a service account API credential as a JSON file

cat .json | base64 | pbcopy

Add the following environment variables

GCE_URL
@sjlu
sjlu / notes.md
Created Oct 19, 2015
Kubernetes and Google Container Engine cheatsheet
View notes.md

Setting project:

gcloud config set project tidy-bindery-110323

Creating a cluster:

gcloud container clusters create web --num-nodes=1 --machine-type=g1-small --zone=us-east1-b
You can’t perform that action at this time.