Skip to content

Instantly share code, notes, and snippets.

View diablofong's full-sized avatar

duncan diablofong

View GitHub Profile
@diablofong
diablofong / gulpfile.js
Created August 18, 2017 17:25 — forked from Falconerd/gulpfile.js
Gulp + Watchify + Babelify + BrowserSync
/**
* This gulpfile will copy static libraries and a index.html file as well as
* merge, babelify and uglify the rest of the javascript project.
*
* TODO:
* - Separate media, libs and src with different watchers.
* - Media and libs should only be copied to dist if they are different sizes.
*
* The expected project is to be laid out as such:
*
@diablofong
diablofong / gulpfile.babel.js
Created August 9, 2017 14:24 — forked from marceloogeda/gulpfile.babel.js
My Gulpfile using ES6 (Babel), Browserify, BrowserSync, SASS, Sourcemaps, and more...
import critical from 'critical';
import babelify from 'babelify';
import browserSync from 'browser-sync';
import browserify from 'browserify';
import buffer from 'vinyl-buffer';
import gulp from 'gulp';
import plugins from 'gulp-load-plugins';
import source from 'vinyl-source-stream';
@diablofong
diablofong / learn_meteor_phase_1.md
Created March 28, 2017 04:23 — forked from xareelee/learn_meteor_phase_1.md
如何學習 Meteor.js (第一階段)

如何學習 Meteor.js (第一階段)

Meteor 是一個 full-stack 的開發框架 (或者該說是平台),它可以利用一種語言 (JavaScript) 來輕鬆完成前後端的開發。是目前前景看好的選擇。

本階段的目標是:

  • 了解 Meteor 是什麼樣的平台,基本架構,可以做到什麼樣的事情 (2.5 hr)
  • 能夠自己獨立完成一個 Meteor 的 ToDo App (不斷的練習一樣的 App,直到完全熟悉,+10 hr)

這階段大約花 10-20 hr,可以利用一個週末的兩天時間,或是一個禮拜的晚上來完成。

@diablofong
diablofong / view-and-data.js
Created July 1, 2016 01:09
view-and-data miss scope
_self.getToken = function() {
var params = {
client_secret: config.credentials.ConsumerSecret,
client_id: config.credentials.ConsumerKey,
grant_type: 'client_credentials'
//miss scope
scope : 'data:read data:write bucket:create bucket:read'
};

在 Windows 用 Vagrant 快速建立你的 Linux 環境

Vagrant 是啥?

Vagrant 幫助你秒建虛擬機,甚至幫你安裝軟體到這個虛擬機,讓你躺著獲得測試環境

為何要用虛擬機

這樣一來,

@diablofong
diablofong / nginxproxy.md
Created February 3, 2016 08:27 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@diablofong
diablofong / requestUpload.js
Created December 26, 2015 14:20 — forked from Fire-/requestUpload.js
example for uploading files to Hipchat with the v2 api with node.js and the Request package
var request = require('request'), //ezmode
fs = require('fs');
var uploadFileName = 'tit.jpg'; // this is a local file, but could be any file or data you want to read in
//ITS A BIRD I SWEAR
fs.readFile('./' + uploadFileName, function read(err, data) {
// hipchat appears to expect the file as a byte array
// and does not support Content-Transfer-Encoding at the time of this gist's creation
request.post({
@diablofong
diablofong / attictv.jobs.zh.md
Created October 26, 2015 13:58 — forked from conancat/attictv.jobs.zh.md
AtticTV 正在募集Web前端、後端兼職開發人員,以及UI與廣告設計人員。你可以隨時隨地、自由自在地工作。詳細資料如下!

誠徵:前端、後端開發人員,以及UI與廣告設計人員

職位:兼職/自由接案人員

  • 職務:前端、後端開發人員,以及UI與廣告設計人員
  • 若合作愉快,有機會轉正職!

責任:協助我們打造東南亞及亞太地區最棒的新聞應用程式!

這意味著:

var rp = require('request-promise');
var id = "echo";
console.log(id);
rp(options).then(
function(body) {
id = body.sessionId;
console.log(id);
})
.catch(function(response) {
yum install -y php56w php56w-opcache php56w-dba php56w-devel php56w-embedded php56w-enchant php56w-fpm php56w-gd php56w-imap php56w-interbase php56w-intl php56w-ldap php56w-mbstring php56w-mcrypt php56w-mssql php56w-mysqlnd php56w-odbc php56w-opcache php56w-pdo php56w-pear php56w-pecl-apcu php56w-pecl-gearman php56w-pecl-geoip php56w-pecl-imagick php56w-pecl-memcache php56w-pecl-xdebug php56w-pgsql php56w-phpdbg php56w-process php56w-pspell php56w-recode php56w-snmp php56w-soap php56w-tidy php56w-xml php56w-xmlrpc