This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <winsock2.h> | |
| #include <ws2tcpip.h> | |
| #include <iphlpapi.h> | |
| #include <stdio.h> | |
| // Need to link with Iphlpapi.lib and Ws2_32.lib | |
| #pragma comment(lib, "iphlpapi.lib") | |
| #pragma comment(lib, "ws2_32.lib") | |
| #define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <windows.h> | |
| #include <boost/thread/thread.hpp> | |
| LRESULT MsgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { | |
| LRESULT result = 0; | |
| switch (message) { | |
| case WM_TIMER: | |
| std::cout << "WM_TIMER" << std::endl; | |
| result = 1; | |
| break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // bsm.cpp : Defines the entry point for the application. | |
| // | |
| #include "stdafx.h" | |
| #include "bsm.h" | |
| HINSTANCE hInst; | |
| TCHAR szTitle[] = TEXT(""); | |
| TCHAR szWindowClass[] = TEXT(" "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "net/http" | |
| "os" | |
| "strconv" | |
| ) | |
| func handler(w http.ResponseWriter, r *http.Request) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # | |
| # Copyright (c) 2009 Google Inc. All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without | |
| # modification, are permitted provided that the following conditions are | |
| # met: | |
| # | |
| # * Redistributions of source code must retain the above copyright | |
| # notice, this list of conditions and the following disclaimer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void run_process(const wchar_t* name, const wchar_t* param) { | |
| SHELLEXECUTEINFOW info; | |
| info.cbSize = sizeof(SHELLEXECUTEINFOW); | |
| info.fMask = SEE_MASK_NOCLOSEPROCESS; | |
| info.hwnd = NULL; | |
| info.lpVerb = NULL; | |
| info.lpFile = name; | |
| info.lpParameters = param; | |
| info.lpDirectory = NULL; | |
| info.nShow = SW_HIDE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| HOST = '127.0.0.1' | |
| try: | |
| s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| s1.bind((HOST, 13748)) | |
| s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| s2.bind((HOST, 15428)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "encoding/binary" | |
| "fmt" | |
| "net" | |
| "time" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "compress/gzip" | |
| "fmt" | |
| "io" | |
| "math/rand" | |
| "net/http" | |
| "net/url" |