Skip to content

Instantly share code, notes, and snippets.

@pankajp
pankajp / serve_http.py
Last active February 5, 2024 17:51
Simple Python HTTP Server with multi-threading and partial-content support
#! /usr/bin/env python
# Standard library imports.
from SocketServer import ThreadingMixIn
import BaseHTTPServer
import SimpleHTTPServer
import sys
import json
import os
from os.path import (join, exists, dirname, abspath, isabs, sep, walk, splitext,
@BoldBigflank
BoldBigflank / Image2Map.py
Last active November 29, 2023 12:43
Convert an image of a map into its generated tile-set.Command line args: tileWidth, tileHeight, fileexample:python Image2Map.py 16 16 map.png
# Filename : Image2Map.py
# Authors : Alex Swan, Georg Muntingh and Bjorn Lindeijer
# Version : 1.3
# Date : June 17, 2013
# Copyright : Public Domain
import os, sys, networkx
from PIL import Image
class TileMap:
@mwunsch
mwunsch / emojiToImage.js
Created December 16, 2012 01:24
Replace emoji characters in a string with an image of said emoji.
// (c) 2012 Mark Wunsch http://markwunsch.com
// MIT license.
if (!String.fromCodePoint) {
/*!
* ES6 Unicode Shims 0.1
* (c) 2012 Steven Levithan <http://slevithan.com/>
* MIT License
*/
String.fromCodePoint = function fromCodePoint () {
@joewest
joewest / app.js
Created December 14, 2011 16:17
ember.js login form
App = Ember.Application.create({});
App.loginController = Ember.Object.create({
// do login stuff
});
App.LoginFormView = Ember.View.extend({
login: null,
password: null,