Skip to content

Instantly share code, notes, and snippets.

# Filename : Image2Map.py
# Authors : Georg Muntingh and Bjorn Lindeijer
# Version : 1.2
# Date : June 16, 2010
# Copyright : Public Domain
import os, sys, Image, networkx
class TileMap:
""" This class represents a map of tiles.
@phyreman
phyreman / Image2Map.js
Last active August 4, 2023 23:22
Can run on any platform that can run a Node.js application. This program will create both the unique tileset and the .tmx file. A working web-based version is available here: http://jsfiddle.net/phyreman/GJ6Qr/
/*
* Filename : Image2Map.js
* Authors : John-Michael Glenn
* Version : 1.3
* Created : June 24, 2013
* Modified : March 31, 2014
* Copyright : Public Domain
**/
// Load modules
@wpsmith
wpsmith / gist:6067068
Created July 23, 2013 23:39
RegEx: Notepad++ Append & Prepend to each line
Press CTRL-H to bring up the Find/Replace Dialog. Choose the "Regular expressions" checkbox near the bottom of the dialog.
To add "test" to the beginning of each line, type "^" in the "Find what" field, and "test" in the "Replace with" field. Then hit "Replace All".
To add "test" to the end of each line, type "$" in the "Find what" field, and "test" in the "Replace with" field. Then hit "Replace All".
@thinkclay
thinkclay / ftp.php
Created August 3, 2013 00:53
A simple PHP FTP class to list and download files
<?php
class FTP {
/**
* Download() performs an automatic syncing of files and folders from a remote location
* preserving folder and file names and structure
*
* @param $local_dir: The directory to put the files, must be in app path and be writeable
* @param $remote_dir: The directory to start traversing from. Use "." for root dir
@hofmannsven
hofmannsven / README.md
Last active February 24, 2026 02:03
Git CLI Cheatsheet
@mwhite
mwhite / git-aliases.md
Last active February 9, 2026 11:08
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@bMinaise
bMinaise / bs3-login-form.html
Created November 6, 2013 02:20
Bootstrap 3 - Login Form Example From: http://bootsnipp.com
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
<h1 class="text-center login-title">Sign in to continue to Bootsnipp</h1>
<div class="account-wall">
<img class="profile-img" src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120"
alt="">
<form class="form-signin">
<input type="text" class="form-control" placeholder="Email" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>
@davfre
davfre / git_cheat-sheet.md
Last active February 26, 2026 16:40
git commandline cheat-sheet
@sprintingdev
sprintingdev / relative_to_absolute_path.py
Created February 6, 2014 12:47
A python script to replace relative paths in src/href attributes of HTML with absolute paths. Created with help from http://stackoverflow.com/questions/3836644/c-sharp-convert-relative-to-absolute-links-in-html-string and http://docs.python.org/2/howto/regex.html
#!/usr/bin/env python
import re
import os
def srcrepl(match):
"Return the file contents with paths replaced"
absolutePath = "http://www.example.com/" #update the URL to be prefixed here.
print "<" + match.group(1) + match.group(2) + "=" + "\"" + absolutePath + match.group(3) + match.group(4) + "\"" + ">"
return "<" + match.group(1) + match.group(2) + "=" + "\"" + absolutePath + match.group(3) + match.group(4) + "\"" + ">"
#
@niksumeiko
niksumeiko / git.migrate
Last active February 10, 2026 06:15
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.