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
@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
@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
@sjlu
sjlu / cloudflare-ddclient.patch
Created Aug 16, 2014
CloudFlare ddclient patch
View cloudflare-ddclient.patch
--- ddclient.orig 2013-09-26 01:06:12.399990673 +0100
+++ ddclient 2013-09-26 06:25:36.768189452 +0100
@@ -13,12 +13,17 @@
# Support for multiple IP numbers added by
# Astaro AG, Ingo Schwarze <ischwarze-OOs/4mkCeqbQT0dZR+AlfA@public.gmane.org> September 16, 2008
#
+# Modified to work with Cloudflare by Robert Ian Hawdon 2012-07-16: http://robertianhawdon.me.uk/
+#
+# Further modified to work with Cloudflare by Peter Roberts 2013-9-26, 2014-6-22: blog.peter-r.co.uk
+#
View app.js
var Sequelize = require('sequelize');
var DataTypes = Sequelize;
sequelize = new Sequelize('mysql://root@localhost/29165644', {});
var Module = sequelize.define('module', {
id: DataTypes.INTEGER,
name: DataTypes.STRING,
description: DataTypes.STRING,
category_id: DataTypes.STRING,
@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
})
You can’t perform that action at this time.