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 / 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) {
@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 / 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 / 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 / shell.nix
Last active August 29, 2015 14:22
shell.nix for Yesod and ghc 7.84
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc784" }:
let
inherit (nixpkgs) pkgs;
f = { mkDerivation, aeson, base, bytestring, classy-prelude
, classy-prelude-conduit, classy-prelude-yesod, conduit, containers
, data-default, directory, fast-logger, file-embed, hjsmin, hspec
, http-conduit, monad-control, monad-logger, persistent
@calvinchengx
calvinchengx / hardware-configuration.nix
Last active August 29, 2015 14:23
hardware config for direct disk (SCSI) boot on Linode KVM
# Do not modify this file! It was generated by �~@~Xnixos-generate-config�~@~Y
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
CalvinMBP s004 Sat 4 Jul 9:33 | ~ |
calvin % traceroute gitlab.algoaccess.com
traceroute to gitlab.algoaccess.com (103.3.62.131), 64 hops max, 52 byte packets
1 192.168.1.1 (192.168.1.1) 2.686 ms 2.725 ms 6.624 ms
2 172.20.0.1 (172.20.0.1) 10.174 ms 14.087 ms 12.919 ms
3 40ge-103-6-148-45.myrepublic.com.sg (103.6.148.45) 12.223 ms 9.926 ms 13.172 ms
4 10gigabitethernet1-1.core1.sin1.he.net (202.79.197.81) 20.239 ms 4.098 ms 9.642 ms
5 74.82.46.190 (74.82.46.190) 40.570 ms 44.519 ms 43.983 ms
IPAddress ipAddress = IPAddress.Parse("xx.xx.xx.xx");
int port = 3003;
int bufferSize = 1024;
TcpClient client = new TcpClient();
NetworkStream netStream;
// Connect to server
try
{
[Session started at 2011-03-09 20:56:30 +0800.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1510) (Fri Oct 22 04:12:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys001
Loading program into debugger…
Program loaded.
Process: Safari [21106]
Path: /Applications/Safari.app/Contents/MacOS/Safari
Identifier: com.apple.Safari
Version: 5.0.4 (6533.20.27)
Build Info: WebBrowser-75332027~1
Code Type: X86-64 (Native)
Parent Process: launchd [204]
Date/Time: 2011-03-15 17:22:44.776 +0800
OS Version: Mac OS X 10.6.6 (10J567)