Skip to content

Instantly share code, notes, and snippets.

View askdaddy's full-sized avatar

Seven Chan askdaddy

  • Internet
View GitHub Profile
static DWORD GetProcessId(HANDLE hProcess)
{
typedef DWORD (WINAPI *pfnGPI)(HANDLE);
typedef ULONG (WINAPI *pfnNTQIP)(HANDLE, ULONG, PVOID, ULONG, PULONG);
static int first = 1;
static pfnGPI GetProcessId;
static pfnNTQIP ZwQueryInformationProcess;
if (first) {
@epicserve
epicserve / svn_to_git.rst
Created September 15, 2011 17:17
Convert SVN Repositories to Git Repositories

Convert SVN Repositories to Git Repositories

This guide on how to convert an SVN repository to a git repository was mostly taken from John Albin Wilkins post on Converting a Subversion repository to Git.

1. Retrieve a list of all Subversion committers

:

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@winhamwr
winhamwr / tutorial.md
Created June 4, 2012 22:37
Creating a repeatable, dynamic site to site VPN with OpenSwan on Ubuntu 10.04 from Amazon EC2

Creating a dynamic site-to-site VPN with OpenSwan on Ubuntu 10.04 on EC2

Wes Winham winhamwr@gmail.com

There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.

@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@mebens
mebens / example.lua
Created November 16, 2012 04:24
Doubly linked list in Lua
require("list")
local a = { 3 }
local b = { 4 }
local l = list({ 2 }, a, b, { 5 })
l:pop()
l:shift()
l:push({ 6 })
l:unshift({ 7 })
@mocchira
mocchira / curl_range.md
Last active March 4, 2024 04:17
HTTP GET with Range header by curl
  • normal(explicitly specified start AND end)
  curl -v -X GET -H "range: bytes=1-8" http://localhost:8080/bbb/test
  • specified ONLY start(end will be specified at the end of file)
  curl -v -X GET -H "range: bytes=10-" http://localhost:8080/bbb/test
  • specified ONLY one negative value(last N bytes of file will be retrieved)
@mudge
mudge / eventemitter.js
Last active April 23, 2024 18:46
A very simple EventEmitter in pure JavaScript (suitable for both node.js and browsers).
/* Polyfill indexOf. */
var indexOf;
if (typeof Array.prototype.indexOf === 'function') {
indexOf = function (haystack, needle) {
return haystack.indexOf(needle);
};
} else {
indexOf = function (haystack, needle) {
var i = 0, length = haystack.length, idx = -1, found = false;
@hugodias
hugodias / gist:7563544
Created November 20, 2013 13:55
Configure PhpStorm to play nicely with CakePHP
Wednesday, August 24, 2011
Configure PhpStorm to Auto-complete CakePHP Models, Views, and Controllers
After playing around a bit today I finally figured out how to get PhpStorm to auto-complete methods for models and controllers. Here's what you need to do.
Removing Multiple Definitions
First, let's tackle the multiple definitions problem that we see below.
##################### ElasticSearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# ElasticSearch comes with reasonable defaults for most settings,