Skip to content

Instantly share code, notes, and snippets.

View zhaiduo's full-sized avatar
💭
hello world

Adam zhaiduo

💭
hello world
View GitHub Profile
@zhaiduo
zhaiduo / Install-letscrypt.md
Created May 2, 2018 06:50 — forked from publiclass1/Install-letscrypt.md
Install letscrypt with nginx

INSTALL LET’S ENCRYPT

To start, we need to install some tools that Let’s Encrypt depends on, then clone the letsencrypt repository to our server.

# Install tools that Let’s Encrypt requires
sudo apt-get install bc

# Clone the Let’s Encrypt repository to your server
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt

Sublime Text 3 configuration

subl config

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Custom color schemes

@zhaiduo
zhaiduo / node_env.py
Created April 27, 2018 06:25 — forked from joesepi/node_env.py
Updated python script to manage nvm and ST3 pathing for OSX
# Sublime package NVM node path configuration
# Save this file in:
# ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/node_env.py
import os
os.environ["PATH"] = "/Users/YOUR_USERNAME/.nvm/v0.10.26/bin:/Users/cranemes/.nvm/v0.10.26/lib:/Users/YOUR_USERNAME/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
print("PATH=" + os.environ["PATH"])
@zhaiduo
zhaiduo / ffmpeg-install.sh
Created April 27, 2018 06:24 — forked from clayton/ffmpeg-install.sh
Install FFMPEG on OS X with HomeBrew to convert Mp4 to WebM
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm
@zhaiduo
zhaiduo / .eslintrc.js
Created April 10, 2018 03:20 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@zhaiduo
zhaiduo / proxies-es5.js
Created August 10, 2017 06:07 — forked from rauschma/proxies-es5.js
ES6 proxies in ES5
//----- The ECMAScript 6 meta object protocol (MOP) implemented in ES5
// This is how getting a property is handled internally.
// Double underscore (__) implies internal operation.
Object.prototype.__Get__ = function (propKey, receiver) {
receiver = receiver || this;
var desc = this.__GetOwnProperty__(propKey);
if (desc === undefined) {
var parent = this.__GetPrototypeOf__();
if (parent === null) return undefined;
@zhaiduo
zhaiduo / autopair-underscores-backticks.json
Created April 24, 2017 10:29 — forked from ckunte/autopair-underscores-backticks.json
Autopair underscores and backticks in Sublime Text (2) -- for Markdown editing. Save the following under Preferences → Key Bindings - User
[ // Auto-pair underscores
{ "keys": ["_"], "command": "insert_snippet", "args": {"contents": "_$0_"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[_a-zA-Z0-9_]$", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.underscore", "match_all": true }
]
},
@zhaiduo
zhaiduo / Default.sublime-theme
Created March 16, 2017 05:33 — forked from MrDrews/Default.sublime-theme
Solarized (light) -- Complement the stock Solarized (light) theme in sublime text 3 by placing this `Default.sublime-theme` inside the `Packages/User` folder. It will recolor the sidebar.
[
{
"class": "sidebar_container",
// $base02: #073642
"layer0.tint": [7,54,66],
"layer0.opacity": 1.0,
"layer0.draw_center": false,
"layer0.inner_margin": [0, 0, 1, 0],
"content_margin": [0, 0, 1, 0]
@zhaiduo
zhaiduo / karma.conf.js
Created October 11, 2016 09:37
ES6 + Babel + Browserify + Mocha + Chai + Karma + Istanbul + PhantomJS
var istanbul = require('browserify-istanbul');
module.exports = function (config) {
config.set({
basePath: '../',
files: ['src/scripts/**/*.js', 'test/unit/**/*.js'],
frameworks: ['browserify', 'mocha', 'chai'],
browsers: ['PhantomJS'], // 'Chrome'
@zhaiduo
zhaiduo / README.md
Created September 14, 2016 07:22 — forked from rowanmanning/README.md
Writing a Friendly README. This a companion-gist to the post: http://rowanmanning.com/posts/writing-a-friendly-readme/