Skip to content

Instantly share code, notes, and snippets.

@weeble
weeble / gist:4754719
Created February 11, 2013 14:32
Resize the body element to be 800px wide. Created with http://www.squarefree.com/userstyles/make-bookmarklet.html and tested in Google Chrome only.
javascript:styles='body {width: 800px; margin-left: auto; margin-right: auto; position:relative; margin-top:0;}'; newSS = document.createElement('link'); newSS.rel = 'stylesheet'; newSS.href = 'data:text/css,' + escape(styles); document.documentElement.childNodes[0].appendChild(newSS); void 0
title Robot Repairs 1.2
author Weeble
homepage www.twitter.com/weeble
run_rules_on_level_start
again_interval 0.05
key_repeat_interval 0.12
noaction
========
OBJECTS
title Robot Repairs 1.2
author Weeble
homepage www.twitter.com/weeble
run_rules_on_level_start
again_interval 0.05
key_repeat_interval 0.12
noaction
========
OBJECTS
@weeble
weeble / script.txt
Last active December 26, 2015 01:39
Tiny Treasure Hunt 1.1
title tiny treasure hunt 1.1
author Weeble
homepage www.twitter.com/weeble
run_rules_on_level_start
(
Release history:
1.0
* First release
@weeble
weeble / gist:7241969
Created October 30, 2013 23:18
Zap Twitter images
javascript:(function(){var newcss="a.media-thumbnail { display: none; }";if("\v"=="v"){document.createStyleSheet().cssText=newcss}else{var tag=document.createElement("style");tag.type="text/css";document.getElementsByTagName("head")[0].appendChild(tag);tag[(typeof document.body.style.WebkitAppearance=="string")?"innerText":"innerHTML"]=newcss}})();
from collections import namedtuple
def flatten(xs):
return sum(xs, [])
Node = namedtuple('Node', 'value children')
def leaf(name):
return Node(name, [])
@weeble
weeble / gemdrop.py
Last active August 29, 2015 14:05
Bit-twiddling example of gem-drop logic
import numpy as np
def index_of_highest_bit(x):
p = 1
i = 0
while p<x:
p <<= 1
i += 1
return i
@weeble
weeble / drone_logo_circles.svg
Last active October 5, 2018 16:19
Drone logo redrawn to be symmetrical using pure circles.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@weeble
weeble / drone_logo_wide.svg
Last active October 5, 2018 16:38
Drone logo redrawn to be symmetrical but keeping the bottom slightly elliptical.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
print([f"Hello, {first_name} {last_name[0]}. Dork." for first_name, last_name in [[next(x for x in (input(prompt) for _ in iter(object, None)) if x) for prompt in ["First Name: ", "Last Name: "]]]][0])