Skip to content

Instantly share code, notes, and snippets.

View calvinchengx's full-sized avatar
:octocat:
Focusing

Calvin Cheng calvinchengx

:octocat:
Focusing
View GitHub Profile
@calvinchengx
calvinchengx / objc.supp
Last active September 11, 2016 01:55
Valgrind suppression file for Valgrind r14960 on Mac OS X 10.10
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc_zone_malloc
fun:recursive_mutex_init
fun:lock_init
fun:_objc_init
fun:_os_object_init
fun:libdispatch_init
@calvinchengx
calvinchengx / SassMeister-input-HTML.html
Created February 16, 2015 06:22
Generated by SassMeister.com.
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<title>Ophto App</title>
</head>
<body>
@calvinchengx
calvinchengx / SassMeister-input-HTML.html
Created February 16, 2015 06:17
Generated by SassMeister.com.
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<title>Ophto App</title>
</head>
<body>
@calvinchengx
calvinchengx / Example Nodejs
Created May 28, 2014 07:36
Example module export for nodejs libraries
var sjcl = require('sjcl');
var RNCryptor = {};
/*
Takes password string and salt WordArray
Returns key bitArray
*/
module.exports.KeyForPassword = RNCryptor.KeyForPassword = function(password, salt) {
@calvinchengx
calvinchengx / gist:24cf8c48fcd2f0182704
Created May 28, 2014 07:36
Example module export for nodejs libraries
var sjcl = require('sjcl');
var RNCryptor = {};
/*
Takes password string and salt WordArray
Returns key bitArray
*/
module.exports.KeyForPassword = RNCryptor.KeyForPassword = function(password, salt) {
package event
import (
"fmt"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/suite"
{
"data": [
{
"name": "Lessons learnt from Redmart by @Sebastian Deckers",
"start_time": "2013-12-13T13:00:00+0800",
"timezone": "Asia/Singapore",
"location": "Plug-In@Blk71",
"id": "595830510477311"
},
{
import os
import sys
for roots, dirlist , filelist in os.walk(os.curdir):
for file in [os.path.join(roots,filegot) for filegot in filelist]:
if "bz2" not in file:
print "Compressing %s" % (file)
os.system("bzip2 %s" % file)
print ":DONE"
import os
import sys
from threading import Thread, Lock
from Queue import Queue
def report(message):
mutex.acquire()
print message
sys.stdout.flush()
mutex.release()
def show_sudo_users_and_groups(ug, nopasswd):
"""
Helper function that prints out users and groups with sudo (or no passwd sudo) rights.
"""
ug_users = []
ug_groups = []
nopasswd_string = ""
if nopasswd:
nopasswd_string = "no password "