Skip to content

Instantly share code, notes, and snippets.

View Benargee's full-sized avatar

Benargee Benargee

  • Ontario, Canada
View GitHub Profile
@whoo24
whoo24 / client.cpp
Created June 24, 2013 07:15
Basic Winsock Program
#include "stdafx.h"
#include <WinSock2.h>
#include <ws2tcpip.h>
#pragma comment(lib, "Ws2_32.lib")
void run_client()
{
WSADATA wsaData;
WSAStartup( MAKEWORD(2,2), &wsaData );
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active May 28, 2024 15:02
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@lucasferreira
lucasferreira / gist:1135780
Created August 10, 2011 01:21
Get image data in Javascript
//from: http://stackoverflow.com/questions/934012/get-image-data-in-javascript
function getBase64Image(img) {
// Create an empty canvas element
var canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
// Copy the image contents to the canvas
var ctx = canvas.getContext("2d");
@sakti
sakti / SimpleSecureHTTPServer.py
Created December 21, 2010 11:24
simple secure http server using python
'''
SimpleSecureHTTPServer.py - simple HTTP server supporting SSL.
- replace fpem with the location of your .pem server file.
- the default port is 443.
usage: python SimpleSecureHTTPServer.py
Credit: https://code.activestate.com/recipes/442473-simple-http-server-supporting-ssl-secure-communica/
License: PSF License