Skip to content

Instantly share code, notes, and snippets.

@ciscoheat
ciscoheat / animation.xaml
Last active December 4, 2015 23:52
Silverlight animation declaration...
<Canvas xmlns="..." xmlns:x="..." ...>
<Canvas.Resources>
<Storyboard
x:Name="mouseEnterAnimation">
<ColorAnimation
Duration="00:00:0.2"
To="Purple"
Storyboard.TargetProperty=
"(Shape.Fill).(GradientBrush.
GradientStops)[1].
@ciscoheat
ciscoheat / domready.js
Created February 10, 2016 20:36 — forked from ded/domready.js
Smallest x-browser DOM Ready, ever [WORKING]
function r(f){/(un|ing)/.test(document.readyState)?setTimeout(r,9,f):f()}
@ciscoheat
ciscoheat / UUID.hx
Created April 3, 2016 05:20
Quick UUID generator in Haxe
class UUID {
public static function uuid() {
// Based on https://gist.github.com/LeverOne/1308368
var uid = new StringBuf(), a = 8;
uid.add(StringTools.hex(Std.int(Date.now().getTime()), 8));
while((a++) < 36) {
uid.add(a*51 & 52 != 0
? StringTools.hex(a^15 != 0 ? 8^Std.int(Math.random() * (a^20 != 0 ? 16 : 4)) : 4)
: "-"
);
@ciscoheat
ciscoheat / Routes.hx
Last active August 26, 2016 19:51
Typesafe web routes with Haxe in less than 100 lines
// Code for this article:
// https://github.com/ciscoheat/mithril-hx/wiki/Typesafe-web-routes-with-Haxe-in-less-than-100-lines
#if macro
import haxe.Serializer;
import haxe.Unserializer;
import haxe.macro.Context;
import haxe.macro.Expr;
import sys.io.File;
@ciscoheat
ciscoheat / jot.bat
Last active February 3, 2017 02:46
Jot - Quick creation and execution of Haxe files
@echo off
setlocal enabledelayedexpansion
if [%1]==[] goto usage
if [%1]==[init] goto init
if [%1]==[watch] goto watch
for %%i in ("%1") do (
set filepath=%%~di%%~pi
set filename=%%~ni

Keybase proof

I hereby claim:

  • I am ciscoheat on github.
  • I am ciscoheat (https://keybase.io/ciscoheat) on keybase.
  • I have a public key whose fingerprint is E709 AD73 FCD9 B916 60D9 1D3B E9B6 A3C2 24D2 5822

To claim this, I am signing this object:

@ciscoheat
ciscoheat / Log.hx
Created July 24, 2018 07:46
Haxe logging with nodejs, js-kit and papertrail
#if nodejs
import haxe.Timer;
import js.Node;
import js.node.Path;
import js.npm.Winston;
import js.npm.winston.transports.Console;
import js.npm.winston.transports.File;
#if !no_papertrail
import js.npm.winston.transports.Papertrail;
#end
### Keybase proof
I hereby claim:
* I am ciscoheat on github.
* I am ciscoheat (https://keybase.io/ciscoheat) on keybase.
* I have a public key whose fingerprint is A969 E858 3A9F B743 FE09 8EC0 9E88 8154 F58D CFB3
To claim this, I am signing this object:
@ciscoheat
ciscoheat / APIError.ts
Last active October 31, 2022 21:11
Javascript APIError class based on RFC7807
import type { Problem } from './Problem'
/**
* Javascript error class based on RFC7807.
* @link https://www.rfc-editor.org/rfc/rfc7807
*/
export class APIError extends Error implements Problem {
type: string;
title?: string;
status?: number;
@ciscoheat
ciscoheat / rimraf.bat
Last active May 11, 2023 06:46
Batch file version of deleting large directories on Windows: https://stackoverflow.com/a/6208144/70894
@echo off
IF "%1" == "" (
echo Usage: rimraf ^[^/f^|-f^|--force^] dir
EXIT /B 1
)
IF "%1" == "/f" GOTO rimraf
IF "%1" == "/F" GOTO rimraf
IF "%1" == "-f" GOTO rimraf