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
@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:
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 / ⓒⓘⓡⓒⓛⓔⓁⓔⓣⓣⓔⓡⓢ⊙ⓟⓨ
Created June 25, 2012 08:11
Circle letters from non-circled letters.
# -*- 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)
@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.
/* 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.
#!/bin/bash
#Fix babel compilation error; --plugins transform-class-properties likes to make global functions which overwrite each other if you have two files with class properties.
#This should be fixed by using webpack. See https://github.com/markerikson/react-redux-links/blob/master/webpack-tutorials.md
set -eu
set -o pipefail
MODULENAME=$(echo $1 | perl -lne 's/([^\/]*?)\.// or next; s/\s.*//; print $1') #extract the filename from the path
perl -pi.bak -e "s|_initialiseProps|_initialiseProps_in_${MODULENAME//-/_}|g" $1 && rm $1.bak #rename all occurences of _initialiseProps, appending _in_«file_name»
@DDR0
DDR0 / log.txt
Created September 23, 2017 21:32
$ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
0 in ~/html/emotebuilder git:(master)
$ npm cache clean -g --force
npm WARN using --force I sure hope you know what you are doing.
0 in ~/html/emotebuilder git:(master)
$ rm node_modules -rf
0 in ~/html/emotebuilder git:(master)
$ npm install
npm WARN deprecated typings@1.3.1: Typings is deprecated in favor of NPM @types -- see README for more information
javascript:(function(){const%20filterHolder%20%3D%20document.createElement(%27div%27)%3BfilterHolder.innerHTML%20%3D%20%60%3Csvg%20color-interpolation-filters%3D%22sRGB%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22pixelate%22%20x%3D%220%25%22%20y%3D%220%25%22%20width%3D%22100%25%22%20height%3D%22100%25%22%3E%3C!--Thanks%20to%20Zoltan%20Fegyver%20for%20figuring%20out%20pixelation%20and%20producing%20the%20awesome%20pixelation%20map.%20--%3E%3CfeGaussianBlur%20stdDeviation%3D%222%22%20in%3D%22SourceGraphic%22%20result%3D%22smoothed%22%3E%3C%2FfeGaussianBlur%3E%3CfeImage%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA1SURBVBhXDccxAQAADMKwSkUCEpCABKRu%2BcJGR4aHBistKS7qPzQkOCh%2FUxNjI%2F9FRYSFxAEwbBkB3dsQzwAAAABJRU5ErkJggg%3D%3D%22%20result%3D%22displacement-map%22%20width%3D%225%22%20height%3D%225%22%3E%3C%2FfeImage%3E%3CfeTile%20in%3D%22displacement-map%22%20result%3D%22pixelate-map%22%3E%3C%2FfeTile%3E%3C
@DDR0
DDR0 / notes of the unterzee.txt
Created November 6, 2017 15:04
Sunless Sea notes
notes of the unterzee
Things:
- solacefruit usually grows far to the north of the uddershroom
- dark-spectacled admiral
- buys moves in the great game for e30, 1 favour
Places:
u1 fallen london
u2 hunter's keep
@DDR0
DDR0 / Feld0 on Mario through the ages.txt
Created January 11, 2018 07:25
A short piece of copypasta about Mario games.
[11:01 PM] Feld0:
I haven't gotten to the end of Super Mario Odyssey yet but I've been spoiled with Yoshi's appearance
I don't like it, no
I want another game to come out that, like Super Mario World, allows Mario to take Yoshi with him for the entire adventure. Not the bullcrap of containing him to specific levels.
Or have Yoshi be a first-rate playable character in his own right like in Super Mario 64 DS
Containing him to specific levels relegates him to a puzzle-solving gimmick. Making him a main character for the entire adventure makes him, well, a character with personality and history.
Not that Mario was ever really about complex storytelling but there has historically been enough there to let your imagination run wild about why Mario does what he does
Fantasizing about why Bowser keeps kidnapping Peach and why Mario will put up with absolutely anything to get her back helps add some motivation to the whole thing
Super Mario Galaxy nailed this IMO by giving Rosalina an elaborate backstory and presentin