Skip to content

Instantly share code, notes, and snippets.

@DanTup
DanTup / dart_download.strace
Last active May 10, 2019
Simple Dart script to download data for testing WSL hangs
View dart_download.strace
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)
@DanTup
DanTup / proxy_test.dart
Created Jan 2, 2019
Dart localhost WebSocket proxy test script
View proxy_test.dart
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 / README.md
Last active Dec 16, 2018
Custom Cura definition for Monoprice Ultimate
View README.md

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!).

View hello_dart.js
// 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].
View Actual cube state.txt
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
@DanTup
DanTup / dart.md
Created Mar 3, 2017 — forked from paulmillr/dart.md
Leaked internal google dart email
View dart.md

---------- 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 / code.cs
Last active Nov 30, 2016
PoSh module for formatting objects using Razor
View code.cs
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
View Setup
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 / delete_comments_likes.js
Last active Jan 21, 2020
Delete all Facebook posts for a year
View delete_comments_likes.js
// 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');
View WebGL2DSprite.html
<!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" />
You can’t perform that action at this time.