Skip to content

Instantly share code, notes, and snippets.

View aaronchiang's full-sized avatar

Aaron Chiang aaronchiang

View GitHub Profile
var express = require('express')
, http = require('http')
, connect = require('connect')
, io = require('socket.io');
var app = express();
/* NOTE: We'll need to refer to the sessionStore container later. To
* accomplish this, we'll create our own and pass it to Express
* rather than letting it create its own. */
var sessionStore = new connect.session.MemoryStore();
//express3.0
var express = require('express');
var app = express();
app.set('port', 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.methodOverride());
//session & cookie
@aaronchiang
aaronchiang / 0_reuse_code.js
Created April 21, 2014 05:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
SERVER="dc1.us.yourcompany.com"
DN="CN=aUserLogin,OU=SomeOrgUnit,OU=AnotherOrgUnit,DC=dc1,DC=us,DC=yourcompany,DC=com"
PASSWORD="aUserLoginsPassword"
OU="ou=AnotherOrgUnit,dc=us,dc=yourcompany,dc=com"
ldapsearch -h "$SERVER" -p 389 \
-x -D "$DN" -w "$PASSWORD" \
-t -s sub -b "$OU" "(&(objectClass=user)(sAMAccountName=anotherUserLogin))" "thumbnailPhoto"
<?php
/**
* LDAP PHP Change Password Webpage
* @author: Matt Rude <http://mattrude.com>
* @website: http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/
*
*
* GNU GENERAL PUBLIC LICENSE
* Version 2, June 1991

Keybase proof

I hereby claim:

  • I am aaronchiang on github.
  • I am aaronchiang (https://keybase.io/aaronchiang) on keybase.
  • I have a public key whose fingerprint is 2BD3 F52E C726 19E3 84F1 AC31 B6E0 4B4D 3E86 E656

To claim this, I am signing this object:

public static string GetKeyDownString(KeyEventArgs args)
{
var value = "";
if ((Keyboard.Modifiers & ModifierKeys.Control) > 0)
{
value += "Ctrl+";
}
if ((Keyboard.Modifiers & ModifierKeys.Alt) > 0)
@aaronchiang
aaronchiang / OpenWithSublimeText3.bat
Created July 31, 2015 00:50
OpenWithSublimeText3.bat
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@aaronchiang
aaronchiang / reg_vscode.bat
Created January 14, 2016 01:05
OpenWithVSCode on Windows
@echo off
SET codePath=C:\Program Files (x86)\Microsoft VS Code\code.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with VS Code" /t REG_SZ /v "" /d "Open with VS Code" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with VS Code" /t REG_EXPAND_SZ /v "Icon" /d "%codePath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command" /t REG_SZ /v "" /d "%codePath% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with VS Code" /t REG_SZ /v "" /d "Open with VS Code" /f
@aaronchiang
aaronchiang / gist:542f2622d11bc4dd6aebd7af179dfe51
Created May 17, 2016 08:59
Improved the performance for SourceTree on Windows
git config --global core.preloadindex true
git config --global core.fscache true