Skip to content

Instantly share code, notes, and snippets.

View kamwing's full-sized avatar
🥑
Work smarter not harder

Ngai Kam Wing kamwing

🥑
Work smarter not harder
View GitHub Profile
server {
listen 80;
listen [::]:80;
root /usr/share/nginx/html;
index index.html;
location / {
/**
* 说明信息
* 1.目录结构:
* ├── avatar.jpg
* ├── qrcode.jpg
* ├── share-image.js
* ├── simhei.ttf
* └── template.jpg
* 2.备注:若出现资源路径异常时,则使用path.join(__dirname, "./simhei.ttf")的方式进行资源加载
* 3.示例:
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@kamwing
kamwing / SCSS.md
Created July 18, 2017 12:33 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@kamwing
kamwing / default
Created March 19, 2017 02:27 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@kamwing
kamwing / MySQL_macOS_Sierra.md
Created March 19, 2017 01:03 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@kamwing
kamwing / gist:07e0cb988db9edc44832
Created March 28, 2016 12:54 — forked from doofusdavid/gist:6072257
quick and dirty wordpress slug generator in excel for data import from an existing database.
=LOWER(CLEAN(SUBSTITUTE(TRIM(C2)," ","-")))
server {
listen 80;
root /var/www/craft.dev/public;
index index.php index.html index.htm;
server_name craft.dev;
location / {
try_files $uri $uri/ @rewrites;
@kamwing
kamwing / symphony_meet_resources.md
Created November 5, 2012 10:22 — forked from vlad-ghita/symphony_meet_resources.md
Symphony, meet Resources!

1 Intro

[Symphony][1] is great. Let's make it better.

This article is about the process of building your website's frontend, keeping templates DRY, relating Datasources, Events and other Resources to your Pages, code structure and much more. The following haven arisen, in time, from finding myself repeating the same things over and over again.

I assume you know what [master.xsl][2] is and you are using it. If you don't know, check the [default Symphony workspace][3].

2 It all starts with a requirement

@kamwing
kamwing / zsh.md
Created October 27, 2012 03:42 — forked from wenzowski/zsh.md
Oh my zsh in Ubuntu 12.04

Getting zsh to work in ubuntu:

Install zsh

sudo apt-get install zsh

nb. on a Vagrant VM, the default user (vagrant) has password vagrant.

Install oh-my-zsh