Skip to content

Instantly share code, notes, and snippets.

View DanTup's full-sized avatar

Danny Tuppeny DanTup

  • Coded Consultants Ltd
  • England, UK
  • 08:45 (UTC +01:00)
  • X @DanTup
View GitHub Profile
// 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 / 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 / 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 / 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)
let [<Given>] ``something`` () = ()
let [<Given>] ``something else`` () = ()
---
Scenario: TestStuff
Given something
and something else
----
@DanTup
DanTup / default.htm
Created July 9, 2013 15:24
Strange IE10 issue. In IE7/8/9 this code will throw an error (attributes["onchange"] returns null). But in IE10, magic happens, and attributes["onchange"] returns attributes["name"] and the code alerts the name of the element!
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
</head>
<frameset rows="70,*">
<frame src="about:blank">
<frameset cols="165,*">
<frame src="about:blank">
<frame src="settings.htm">
@DanTup
DanTup / SyncKilnAndGitHub.ps1
Last active December 14, 2015 20:39
Scripts to sync a GitHub repo to Kiln to allw GitHub contributions without using Git (use Hg on your Kiln repos!).
<#
.SYNOPSIS
Script to sync a GitHub repo to Kiln to allw GitHub contributions without using Git (use Hg on your Kiln repos!).
.DESCRIPTION
Create a branch repo in Kiln specifically for for the GitHub sync and run this PS script periodically (PoSh v3
scheduled jobs make this easy).
Merge the GitHub branch repo (using Hg!) into your main repo periodically, then push back to the GitHub branch
once done. This will be sync'd back to GitHub when the script next runs.
@DanTup
DanTup / StructureMapRepoBug.cs
Created May 7, 2012 15:05
StructureMap SingleImplementationsOfInterface bug
namespace StructureMapBugRepro
{
using System;
using StructureMap;
using StructureMapBugRepo.NS1;
using StructureMapBugRepo.NS2;
public class Program
{
static void Main(string[] args)
@DanTup
DanTup / VS References Yuml.ps1
Last active October 4, 2015 10:47
Output Visual Studio project references for yuml.me
function Get-ProjectReferences
{
param(
[Parameter(Mandatory)]
[string]$rootFolder,
[string[]]$excludeProjectsContaining
)
dir $rootFolder -Filter *.csproj -Recurse |
@DanTup
DanTup / simple_serialization_tests.dart
Created August 7, 2014 12:06 — forked from sethladd/simple_serialization_tests.dart
+ support for child objects (sorry if it's bad; written in Notepad and don't really know Dart!)
import 'dart:convert';
import 'package:smoke/smoke.dart' as smoke;
@MirrorsUsed(targets: const [SimpleWithMirrors, Simple], override: '*')
import 'dart:mirrors';
abstract class Serializable {
static fromJson(Type t, Map json) {
var typeMirror = reflectType(t);
T obj = typeMirror.newInstance(new Symbol(""), const[]).reflectee;