This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var msgpack = require("msgpack-lite"); | |
var pack = require('pixl-pack'); | |
var tests = [ | |
[ "Null", null ], | |
[ "Boolean", true ], | |
[ "String", "Now is the time for all good men to come to the aid of their country." ], | |
[ "Buffer", Buffer.from("Now is the time for all good men to come to the aid of their country.") ], | |
[ "Number", 12345.67890 ], | |
[ "Object", { foo: "bar", "num": 123 } ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<--- Last few GCs ---> | |
[4433:0x3dc6880] 104473 ms: Scavenge 2019.9 (2024.9) -> 2019.2 (2030.1) MB, 29.9 / 0.0 ms (average mu = 0.297, current mu = 0.284) allocation failure | |
[4433:0x3dc6880] 104641 ms: Scavenge 2022.8 (2030.1) -> 2021.0 (2031.1) MB, 25.6 / 0.0 ms (average mu = 0.297, current mu = 0.284) allocation failure | |
[4433:0x3dc6880] 104766 ms: Scavenge 2023.7 (2031.1) -> 2022.3 (2032.9) MB, 40.8 / 0.0 ms (average mu = 0.297, current mu = 0.284) allocation failure | |
<--- JS stacktrace ---> | |
==== JS stack trace ========================================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { registerFont, createCanvas } = require('canvas'); | |
registerFont( 'AdventPro-Regular.ttf', { family: "AdventProRegular" } ); | |
var canvas = createCanvas( 600, 100 ); | |
var ctx = canvas.getContext( '2d' ); | |
ctx.fillStyle = '#ffffff'; | |
ctx.fillRect( 0, 0, canvas.width, canvas.height ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { registerFont, createCanvas } = require('canvas'); | |
registerFont( 'AdventPro-Bold.ttf', { family: "AdventProBold" } ); | |
registerFont( 'AdventPro-ExtraLight.ttf', { family: "AdventProExtraLight" } ); | |
registerFont( 'AdventPro-Light.ttf', { family: "AdventProLight" } ); | |
registerFont( 'AdventPro-Medium.ttf', { family: "AdventProMedium" } ); | |
registerFont( 'AdventPro-Regular.ttf', { family: "AdventProRegular" } ); | |
registerFont( 'AdventPro-SemiBold.ttf', { family: "AdventProSemiBold" } ); | |
registerFont( 'AdventPro-Thin.ttf', { family: "AdventProThin" } ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Joe's Game Geometry Tools | |
// Copyright (c) 2010 Joseph Huckaby | |
// Released under the MIT License | |
function _RADIANS_TO_DECIMAL(_rad) { return _rad * 180.0 / Math.PI; } | |
function _DECIMAL_TO_RADIANS(_dec) { return _dec * Math.PI / 180.0; } | |
// | |
// Point class | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am jhuckaby on github. | |
* I am jhuckaby (https://keybase.io/jhuckaby) on keybase. | |
* I have a public key whose fingerprint is DF0B 767B 5FD8 8392 F6D4 F46C 04CB 5A33 53BF 6C11 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Set sign text on an already placed sign. */ | |
/* Specify sign block coordinates and array of strings. */ | |
/* This will currently only work on the main overworld on a server. */ | |
/* Usage: /js setsigntext(-847, 63, 107, ["Hello", "There"]); */ | |
/* Author: Joseph Huckaby, December 29, 2013 */ | |
/* License: Public Domain */ | |
// For ScriptCraft 1.7, uncomment this, I think: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// RSS Feed Widget for CubixCloud | |
// by Joseph Huckaby | |
// Copyright (c) 2012 CubixCloud.com | |
// Insert this into your HTML: | |
// <iframe width="570" height="243" frameborder="0" src="cc-news-widget.php" marginwidth="0" marginheight="0" vspace="0" hspace="0" scrolling="no"></iframe> | |
$rss_url = 'http://blog.cubixcloud.com/feed'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# A replacement for Sublime Text 2's built-in "subl" command-line utility, | |
# which forces files into new windows regardless of prefs. | |
# by Joseph Huckaby, 2012 | |
use strict; | |
use Cwd qw/abs_path/; | |
use FileHandle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseQueryString(url) { | |
// parse query string into key/value pairs and return as object | |
var query = {}; | |
url = (url || location.search).replace(/^.*\?/, '').replace(/([^\=]+)\=([^\&]*)\&?/g, function(match, key, value) { | |
query[key] = decodeURIComponent(value); | |
return ''; | |
} ); | |
return query; | |
} |