Skip to content

Instantly share code, notes, and snippets.

@deathcap
deathcap / ls.js
Last active August 25, 2022 18:11
example of transpiling FreeBSD bin/ls/ls.c to JS using https://github.com/deathcap/transpile-c-to-js
function xo_emit_hvp(xop, fmt, vap)
{
return xo_emit_hv(xop, fmt, vap);
}
function xo_emit_hp(xop, fmt, ...args)
{
let vap;
__builtin_va_start(vap);
let rc = xo_emit_hv(xop, fmt, vap);
@deathcap
deathcap / cs2es6.md
Created April 5, 2016 03:21
Some notes on converting CoffeeScript to ECMAScript2015 (ES6)

Some notes on converting CoffeeScript to ECMAScript2015 (ES6) for voxel.js-related projects

Add to beginning of file 'use strict';

Add variable declarations - usually const, but sometimes let More scoping clarity (explicit) with ES6 than CoffeeScript - other criticism of CoffeeScript scoping: CoffeeScript's Scoping is Madness

Add semicolons - although arguably, standard says not, due to semicolon insertion,

@deathcap
deathcap / babel.md
Last active February 17, 2016 07:32
My Big List of Annoyances with Babel/ES6 Transpilation

Complicates development-code distribution: When a user checks out a new revision of the source code from git, the changes won't immediately have any effect, unlike (most) changes from non-transpiled modules. Instead they have to be sure to run npm run-script prepublish to recompile.

Actual user conversation from chatroom (lightly edited for relevance):

developer Jan 24 15:33 update, I fixed that recently
user Jan 24 15:33 ooooohhh, ummm
  the current [module] has that update, or do I need a special fork version from you?
other-developer Jan 24 15:35 It was merged yeah
1c000001a2000021012caa016f020000ffff7f
<--- Last few GCs --->
43864 ms: Scavenge 1401.5 (1457.5) -> 1401.5 (1457.5) MB, 1.7 / 0 ms (+ 17.1 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
44577 ms: Mark-sweep 1401.5 (1457.5) -> 1401.5 (1457.5) MB, 712.7 / 0 ms (+ 35.4 ms in 9 steps since start of marking, biggest step 17.1 ms) [last resort gc].
45272 ms: Mark-sweep 1401.5 (1457.5) -> 1401.5 (1457.5) MB, 694.9 / 0 ms [last resort gc].
@deathcap
deathcap / gist:1e530528e8fb3ae0d67b
Created February 8, 2016 07:58
voxel-clientmc app npm ls diff local vs circleci
~ $ diff -ur /tmp/1 /tmp/2
--- /tmp/1 2016-02-07 23:57:17.000000000 -0800
+++ /tmp/2 2016-02-07 23:57:12.000000000 -0800
@@ -1,5 +1,5 @@
-app $ npm ls
-voxel-clientmc-app@0.0.1 /Users/admin/games/voxeljs/voxel-clientmc/app
+ubuntu@box320:~/voxel-clientmc/app$ npm ls
+voxel-clientmc-app@0.0.1 /home/ubuntu/voxel-clientmc/app
├─┬ browserify@13.0.0
│ ├── assert@1.3.0
git clone https://github.com/Diorite/Diorite
commit edc44b2a9efdcebc412ae87079f9659382c3b5cc Date: Thu Feb 4 13:52:47 2016 +0100
cd Diorite
Diorite $ mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] diorite-parent
@deathcap
deathcap / gist:7c9b94452b0d6f3d9429
Created January 31, 2016 07:07
minecraft-data legacy ping decoding testing
+++ b/data/1.8/protocol.json
@@ -150,7 +150,14 @@
before:
"legacy_server_list_ping": {
"id": "0xfe",
"fields": [
{
"name": "payload",
@deathcap
deathcap / gist:2c31e498b2375053c0e0
Created January 23, 2016 23:53
FML|HS debugging for node-minecraft-protocol
Testing https://github.com/PrismarineJS/node-minecraft-protocol/pull/326
forge-1.8.9-11.15.0.1715
mods/ironchest-1.8.9-6.0.121.768.jar
java -Dfml.debugNetworkHandshake=true -jar forge-1.8.9-11.15.0.1715-universal.jar nogui
tail -F logs/fml-server-latest.log
[15:44:45] [Netty Server IO #6/TRACE] [FML/]: Handshake channel activating
--- https://github.com/Bukkit/Bukkit
+++ https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse
[...]
+commit 277baff1a14c0eb57ef723d625446698a857884e
+Author: md_5 <git@md-5.net>
+Date: Wed Nov 26 08:15:59 2014 +1100
+
+ Update to Minecraft 1.8
+
+ For more information please see http://www.spigotmc.org/
@deathcap
deathcap / gist:d366631d22220d54f25d
Created January 19, 2016 01:25
Glowstone++ 087b643 FML test
>cGlowstone++ $ ./run.sh
+ java -mx2G -jar target/glowstone++-1.8.9-SNAPSHOT.jar
17:24:31 [INFO] This server is running Glowstone++ version Glowstone++-git-"087b643" (Implementing API version 1.8.8-R0.1-SNAPSHOT)
17:24:31 [INFO] Recipes: 295 shaped, 63 shapeless, 24 furnace, 10 dynamic, 14 fuels.
17:24:31 [INFO] 2016-01-18 17:24:31,664 ERROR Error processing element Queue: CLASS_NOT_FOUND
17:24:31 [INFO] 2016-01-18 17:24:31,689 ERROR Unable to locate appender ServerGuiConsole for logger
17:24:31 [INFO] 2016-01-18 17:24:31,690 ERROR Unable to locate appender ServerGuiConsole for logger com.mojang
17:24:31 [INFO] 2016-01-18 17:24:31,690 ERROR Unable to locate appender ServerGuiConsole for logger net.minecraft
17:24:31 [INFO] [17:24:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker