Skip to content

Instantly share code, notes, and snippets.


Sunny Chan sunnycmf

  • Carousell
  • Hong Kong
View GitHub Profile
pborreli / import
Created May 10, 2010
Dealing with mass import in doctrine/pdo using pcntl_fork
View import
class importTask extends sfTask
protected function execute($arguments = array(), $options = array())
$xml = simplexml_load_file('file');
$users = array();
foreach ($xml->users as $user)
anonymous / Responsive-Flat-UI-Kit.markdown
Created Dec 5, 2013
A Pen by Matt Litherland.
View Responsive-Flat-UI-Kit.markdown

Responsive Flat UI Kit

A custom UI set built to work with and sit next to Bootstrap 3. Custom select boxes by @catalinred. 3D Scroll effects inspired by @chriscoyier's slide in when scroll down pen. The kit is also responsive!

Try clicking & hovering everything.

Feel free to fork, heart and share!

A Pen by Matt Litherland on CodePen.

tyler-sommer / fix.rb
Created Oct 17, 2014
Fix broken gitlab hooks in your project repositories
View fix.rb
Dir.glob('/home/git/repositories/**/*.git') do |item|
hook = "#{item}/hooks"
if not File.symlink?(hook)
puts "Updating #{hook}"
File.rename(hook, "#{hook}.old")
File.symlink("/home/git/gitlab-shell/hooks", hook)
sunnycmf /
Last active Mar 7, 2017
Mac OSX Yosemite dev env setup script

Mac OSX softwares and env setup

install homebrew & cask

ruby -e "$(curl -fsSL"
brew install caskroom/cask/brew-cask
brew tap caskroom/versions
brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

Dev tools

jfsiii / img2data.js
Created Jan 30, 2011
base64 encoding images in NodeJS
View img2data.js
* Based on from
* Neither that gist nor this one work for me in 0.2.x or 0.3.x.
var request = require('request'),
BufferList = require('bufferlist').BufferList,
sys = require('sys'),
bl = new BufferList(),
url = ''
sebastianhoitz /
Last active Jan 8, 2020
node.JS streaming zip file
zipstream = require "zipstream"
fs = require "fs"
async = require "async"
class StreamingResponse
filename: ""
files: []
streaming: true
View apache-and-tomcat-logs.json
"title": "Apache and Tomcat Logs",
"services": {
"query": {
"list": {
"0": {
"query": "apache !tomcat !static",
"alias": "",
"color": "#7EB26D",
"id": 0,
jwalton /
Last active Sep 18, 2020
Rickshaw Graph is a drop in replacement for Dashing's graph

Graphing Widget

The graphing widget shows graphs using the Rickshaw graphing library. The names of data fields should be (vaguely) familiar if you've used Rickshaw before.

It's recommended that you replace the /assets/javascripts/rickshaw.min.js from your dashboard with the latest from here.

Supported HTML data fields

sunnycmf / date_dimension.sql
Last active Feb 18, 2021
MySQL Date Dimension generation SQL
View date_dimension.sql
-- Credit to
-- Small-numbers table
DROP TABLE IF EXISTS numbers_small;
CREATE TABLE numbers_small (number INT);
INSERT INTO numbers_small VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-- Main-numbers table
CREATE TABLE numbers (number BIGINT);