Skip to content

Instantly share code, notes, and snippets.

View DanTup's full-sized avatar

Danny Tuppeny DanTup

  • Coded Consultants Ltd
  • England, UK
  • 12:18 (UTC +01:00)
  • X @DanTup
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>MySecondGame</title>
</head>
<body>
<canvas width="1024" height="768"></canvas>
<div style="display: none;">
<img id="img-player" src="assets/player.png" />
@DanTup
DanTup / delete_comments_likes.js
Last active October 17, 2023 21:51
Delete all Facebook posts for a year
// Only tested in Chrome...
// Must browse to "Your Comments" (or "Your Likes") page of activity feed, then pre-load the year you want to delete
// and as many comments as possible (scroll down, they load lazily).
//
// I ACCEPT ABSOLUTELY NO RESPONSIBILITY FOR THIS DOING BAD STUFF. THE NEXT FACEBOOK DEPLOYMENT
// COULD WELL BREAK THIS, OR MAKE IT DO THINGS YOU DO NOT EXPECT. USE IT AS A STARTING POINT ONLY!
//
// It will start failing once it gets to the end, just reload the page and kick it off again.
var rows = document.querySelectorAll('#year_2012 .pam._5shk');
@DanTup
DanTup / Setup
Last active March 30, 2016 20:35
PI_REPO="https://DanTup@github.com/DanTup/Pi.git"
# Danny's Pi Setup script
#
# This script is intended to be run from a newly set up Raspbian install. It just clones my
# (private) Pi repo which contains further scripts and executes them. It will prompt for a
# GitHub access key during the clone because the repo is private.
#
# Run with:
# bash <(curl -sSL https://gist.github.com/DanTup/bcdf20cb300e40c628e8/raw/Setup)
@DanTup
DanTup / code.cs
Last active November 30, 2016 21:26
PoSh module for formatting objects using Razor
function Format-Razor()
{
<#
.SYNOPSIS
Formats a set of objects using the Razor Engine.
.DESCRIPTION
The Format-Razor function formats a set of objects using a supplied template using the Razor Engine created for ASP.NET.
.NOTES
Author: Danny Tuppeny (DanTup)
.LINK
@DanTup
DanTup / dart.md
Created March 3, 2017 13:09 — forked from paulmillr/dart.md
Leaked internal google dart email

---------- Forwarded message ----------

From: Mark S. Miller <erights@google.com>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
To: javascript-standard@google.com
@DanTup
DanTup / Actual cube state.txt
Created March 16, 2017 15:43
MindCub3r Logs
w w w
o o r
g o r
o w y r g y b y g r b b
g b g w y o b g o y w y
y w b r b g o y o g g o
w r y
r r b
b r y
// Generated by dart2js, the Dart to JavaScript compiler version: 1.24.2.
// The code supports the following hooks:
// dartPrint(message):
// if this function is defined it is called instead of the Dart [print]
// method.
//
// dartMainRunner(main, args):
// if this function is defined, the Dart [main] method will not be invoked
// directly. Instead, a closure that will invoke [main], and its arguments
// [args] is passed to [dartMainRunner].
@DanTup
DanTup / README.md
Last active December 16, 2018 19:53
Custom Cura definition for Monoprice Ultimate

Copy this JSON file to ~/Library/Application Support/cura/3.6/definitions/monoprice_ultimate.def.json on macOS (note the Cura version in the path). It'll list a new printer (Monoprice Ultimate) that inherits the Wanhao Duplicator 6 profile but with the correct acceleration/jerk values (at least the defaults for mine).

This will improve the accuracy of time estimates (for example, a Tito head estimated 4hrs without this change, and 7:22 with it - which looks about right given it's 55% through the Gcode after 4:10!).

@DanTup
DanTup / proxy_test.dart
Created January 2, 2019 09:56
Dart localhost WebSocket proxy test script
import 'dart:io';
var port = 3456;
main() async {
print('HTTP_PROXY: ${Platform.environment['HTTP_PROXY']}');
print('NO_PROXY: ${Platform.environment['NO_PROXY']}');
print('');
await test('ws://echo.websocket.org');
@DanTup
DanTup / dart_download.strace
Last active May 10, 2019 16:38
Simple Dart script to download data for testing WSL hangs
This file has been truncated, but you can view the full file.
4514 execve("/home/danny/Dev/Google/flutter/bin/cache/dart-sdk/bin/dart", ["/home/danny/Dev/Google/flutter/b"..., "./dart_download_test.dart"], [/* 18 vars */]) = 0
4514 brk(NULL) = 0x2c1c000
4514 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
4514 mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa18d450000
4514 readlink("/proc/self/exe", "/home/danny/Dev/Google/flutter/b"..., 4096) = 58
4514 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
4514 open("/home/danny/Dev/Google/flutter/bin/cache/dart-sdk/bin/tls/x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
4514 stat("/home/danny/Dev/Google/flutter/bin/cache/dart-sdk/bin/tls/x86_64", 0x7fffd5f28bb0) = -1 ENOENT (No such file or directory)
4514 open("/home/danny/Dev/Google/flutter/bin/cache/dart-sdk/bin/tls/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
4514 stat("/home/danny/Dev/Google/f