Skip to content

Instantly share code, notes, and snippets.

View DDR0's full-sized avatar
πŸ¦‡
Making Stuff

David Roberts DDR0

πŸ¦‡
Making Stuff
View GitHub Profile
/* eslint-env browser */
/* global ce, Promise, google, moment, DOMContentLoadedPromise, GoogleMapLoadedPromise, loggedIn, loggedInAs, Pikaday, React, ReactDOM */
"use strict";
ce.flags.pageHandlesLogout = true;
//Set up step logic, and step interaction with the hash.
DOMContentLoadedPromise.then(()=>{
//Skip a few steps on desktop, since it combines 2, 3 and 4 into one step.
@DDR0
DDR0 / gist:5437738
Created April 22, 2013 19:22
Fixed version of layerData.
lData.moveLayerData = function(oldLayer, newLayer, options) { //Copies the layer image data from the oldLayer to the newLayer in a reasonably efficient manner.
/* oldLayer: The old layer of data to copy from. (type "layerCanvas")
newLayer: The new layer of data to copy to. (May be the old layer.)
options: (map)
oldOrigin.x/y and newOrigin.x/y are optional. They specify the
origin point for the rectange being copied from the old layer
to the new layer, on their respective layers. Will default to
area.x/y if not supplied, or the layer x/y if area not supplied.
channels (optional) specifies the mapping of the channels from old
to new. This works like convertBuffer's outputChannels option.
# -*- coding: utf-8 -*-
import sys
norm = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-=*. "
trans = "β’Άβ’·β’Έβ’Ήβ’Ίβ’»β’Όβ’½β’Ύβ’Ώβ“€β“β“‚β“ƒβ“„β“…β“†β“‡β“ˆβ“‰β“Šβ“‹β“Œβ“β“Žβ“β“β“‘β“’β““β“”β“•β“–β“—β“˜β“™β“šβ“›β“œβ“β“žβ“Ÿβ“ β“‘β“’β“£β“€β“₯ⓦⓧⓨⓩβ“ͺβ‘ β‘‘β‘’β‘£β‘€β‘₯β‘¦β‘§β‘¨βŠβŠœβŠ›βŠ™β—‹"
if len(sys.argv) < 2:
print('Useage: circleLetters.py "string" [-b -n]. (Too few args given.)')
sys.exit(1)
cubetrains /usr/lib/cubetrains/
game /usr/share/cubetrains/
debian/cubetrains-start/cubetrains /usr/games/
data /usr/share/cubetrains/
images /usr/share/cubetrains/
debian/cubetrains.xpm /usr/share/cubetrains
debian/cubetrains.desktop /usr/share/applications
debian/cubetrains.menu /usr/share/applications
@DDR0
DDR0 / plotsweeper.py
Created January 15, 2012 03:06
Minesweeper with the outside ring known.
#MineSweeper variant #10841
#For Python 3
import random, os
## {{{ http://code.activestate.com/recipes/134892/ (r2)
class _Getch:
"""Gets a single character from standard input. Does not echo to the
screen."""
def __init__(self):
try: