Skip to content

Instantly share code, notes, and snippets.

Franklin Ta fta2012

Block or report user

Report or block fta2012

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
fta2012 / ReplicatedRandomChrome.js
Last active Mar 27, 2018
EDIT: This code no longer works on chrome but still works for legacy versions of node. Updated code moved to
View ReplicatedRandomChrome.js
var rngstate;
function MathRandom() {
// Our own implementation of Math.random().
// Source code was copied from
// You need to initialize rngstate with `solve` before this can be used.
// If using node.js, you have to s/18030/18273/g here and in `solve` since they implement it slightly differently:
console.assert(rngstate, "You need to set the global variable `rngstate` first. For example: `rngstate = solve(Math.random(), Math.random());`");
if (!rngstate) return;
var r0 = (Math.imul(18030, rngstate[0] & 0xFFFF) + (rngstate[0] >>> 16)) | 0;
rngstate[0] = r0;
fta2012 / DragTransform
Last active Jun 17, 2019
Slightly modified compiled coffeescript from this codepen: Paste into console on a page that has jQuery to load the two dependent libraries (jquery-ui and numericjs). Then call makeTransformable('#selector-name') to make that element WYSIWYG editable. Use inspector to get the CSS for the transforms.
View DragTransform
var selector = 'img' // Replace this with the selector for the element you want to make transformable
jQuery.getScript('//', function() {
jQuery.getScript('//', function() {
(function() {
var $, applyTransform, getTransform, makeTransformable;
$ = jQuery;
You can’t perform that action at this time.