Skip to content

Instantly share code, notes, and snippets.

View raptium's full-sized avatar
😜

Hao Guan raptium

😜
View GitHub Profile
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import dnet
import os
import time
import commands
import re
' Replace group membership with all-new members
Const ADS_PROPERTY_UPDATE = 2
Set objGroup = GetObject _
("LDAP://cn=testgroup,ou=Users,dc=it,dc=shkp,dc=com,dc=hk")
objGroup.PutEx ADS_PROPERTY_UPDATE, "member", _
Array("cn=keatslee,ou=Users,dc=it,dc=shkp,dc=com,dc=hk", _
"cn=fionachan,ou=Users,dc=it,dc=shkp,dc=com,dc=hk")
diff -r c7fe4a7e8021 .hgignore
--- a/.hgignore Sat May 02 23:06:23 2009 +0800
+++ b/.hgignore Sun May 03 00:48:04 2009 +0800
@@ -7,3 +7,4 @@ syntax: glob
*~
simulation
*.dSYM
+*.dat
diff -r c7fe4a7e8021 lst.c
--- a/lst.c Sat May 02 23:06:23 2009 +0800
#include "Tank.h"
#include <string.h>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <cmath>
namespace net {
namespace raptium {
#include <iostream>
using std::cout;
using std::endl;
using std::string;
class Counter {
private:
int _count;
public:
Counter() {
#include <iostream>
#include <stdexcept>
using std::cout;
using std::ostream;
using std::runtime_error;
struct auto_flush {
~auto_flush() {
cout << "\nflush called\n";
#include <iostream>
#include <stdexcept>
using std::cout;
using std::ostream;
using std::runtime_error;
struct auto_flush {
~auto_flush() {
cout << "\nflush called\n";
@raptium
raptium / ERGWAVE Login
Created February 10, 2011 07:39
Create a bookmark with following text as the URL.
javascript:var $=function(e){return document.getElementById(e)};$('user').value='USERNAME';$('password').value='PASSWORD';document.getElementsByTagName('select')[0].value='IE';$('regform').submit();
@raptium
raptium / convert.py
Created December 31, 2011 11:43
Outlook vcf to iCloud vcf
# -*- coding: utf-8 -*-
def print_entry(name, tel):
tmpl = '''BEGIN:VCARD
VERSION:3.0
N:%s;%s;;;
FN:%s %s
TEL;TYPE=CELL;TYPE=pref;TYPE=VOICE:%s
END:VCARD'''
last = name[0].encode('utf-8')