Skip to content

Instantly share code, notes, and snippets.

Jay Oster parasyte

Block or report user

Report or block parasyte

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@parasyte
parasyte / test_x86.js
Last active Aug 29, 2015
x86_64 example using Capstone bindings for node.js
View test_x86.js
var capstone = require("capstone");
var code = new Buffer([
0x55, 0x48, 0x8b, 0x05, 0xb8, 0x13, 0x00, 0x00
]);
var cs = new capstone.Cs(capstone.ARCH_X86, capstone.MODE_64);
cs.detail = true;
cs.disasm(code, 0x1000).forEach(function (insn) {
console.log(
@parasyte
parasyte / mp.js
Last active Dec 16, 2015
Multiplayer example for melonJS with PubNub
View mp.js
var Multiplayer = Object.extend({
init : function (new_player) {
this.pubnub = PUBNUB.init({
publish_key : 'demo',
subscribe_key : 'demo'
});
this.new_player = new_player;
// Record my UUID, so I don't process my own messages
@parasyte
parasyte / README.md
Last active Dec 17, 2015
PubNub pam.py
View README.md

REST API

The REST API provides secure administrative tasks for managing and auditing permissions (aka Access Control List, or ACL). All of the REST APIs require a cryptographic signature and a timestamp that is reasonably close to NTP time.

Timestamp

The timestamp is an HTTP query parameter following the Unix Time convention

@parasyte
parasyte / hll.py.patch
Created Jun 20, 2013
Memory and CPU optimized HyperLogLog (Python) patch Original: https://github.com/svpcom/hyperloglog
View hll.py.patch
diff --git a/hyperloglog/hll.py b/hyperloglog/hll.py
index cb6b6bc..a16b730 100755
--- a/hyperloglog/hll.py
+++ b/hyperloglog/hll.py
@@ -1,5 +1,7 @@
"""
-This module implements probabilistic data structure which is able to calculate the cardinality of large multisets in a single pass using little auxiliary memory
+This module implements a probabilistic data structure which is able to calculate
+the cardinality of large multi-sets in a single pass using little auxiliary
+memory.
@parasyte
parasyte / menu.js
Last active Dec 29, 2015
Implementing a minimal, recursive menu system in melonJS.
View menu.js
game.MenuItem = me.GUI_Object.extend({
init : function (settings) {
this.pos = new me.Vector2d(settings.x, settings.y);
this.image = me.loader.getImage(settings.image);
this.parentMenu = settings.parentMenu;
this.subMenu = settings.subMenu;
this.callback = settings.callback;
this.name = "MenuItem";
},
@parasyte
parasyte / README.md
Last active Apr 27, 2017
How to delete Apple Java on OS X 10.11 El Capitan
View README.md

Warning: Use at your own risk

I assume no responsibility for the use of these instructions, or any negative impact they may have. You probably shouldn't do this. (Unless you really, truly hate vile cruftware like Java.)

Let the games begin

  1. Reboot into Recovery Mode.
  2. Power-on and hold ⌘ + R until Apple Logo appears.
  3. If your hard drive is encrypted:
  4. Start "Restore From Time Machine Backup"
View n64_tlb.txt
FORMATS
EntryLo0 & EntryLo1:
00 pppppppppppppppppppppppp ccc d v g
(32-bit: 2.24.3.1.1.1)
p = Page frame number; the upper bits of the physical address.
c = Specifies the TLB page coherency attribute. (See below)
d = Dirty. If this bit is set, the page is marked as dirty and, therefore, writable
This bit is actually a write-protect bit that software can use to prevent alteration
@parasyte
parasyte / fixes.md
Created Jun 4, 2019
Nginx bug fixes 1.11.2 ~ 1.6.0
View fixes.md

1.11.3 (26 Jul 2016)

*) Bugfix: socket leak when using HTTP/2.

1.11.5 (11 Oct 2016)

*) Bugfix: in the $realip_remote_addr variable.

@parasyte
parasyte / rustup-bisect
Last active Jun 9, 2019 — forked from passcod/rustup-bisect
A tool to find out what the earliest version that your project supports is!
View rustup-bisect
#!/usr/bin/env bash
# With revisions from @parasyte for macOS compatibility
# Requires bash >= 5 (mapfile)
if [[ "$1" == "--keep-versions" ]]; then
keep_versions="1"
fi
purple="\e[0;35m"
reset="\e[0m"
@parasyte
parasyte / jay-inheritance.js
Last active Jul 3, 2019
Jay inheritance : A *really fast* implementation of JavaScript single inheritance with mixins and a little syntactic sugar to make it go down smoothly. http://blog.kodewerx.org/2014/03/melonjs-should-be-all-about-speed.html || DEPRECATED, See: https://github.com/parasyte/jay-extend
View jay-inheritance.js
/*
* Copyright (c) 2014, Jay Oster
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
You can’t perform that action at this time.