Skip to content

Instantly share code, notes, and snippets.

💭
Typing words

Brandon Jones toji

💭
Typing words
Block or report user

Report or block toji

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
@toji
toji / canvascapture.js
Created Mar 8, 2017
Canvas screenshot bookmarklet
View canvascapture.js
javascript:(function()%7Bw%3Dwindow%3Bs%3D%22requestAnimationFrame%22%3Br%3Dw%5Bs%5D%3Bw%5Bs%5D%3Df%3D%3E%7Bw%5Bs%5D%3Dr%3Br(t%3D%3E%7Bf(t)%3Bl%20%3D%20document.querySelectorAll(%22canvas%22)%3Bfor%20(c%20of%20l)%20%7Bi%3Dnew%20Image()%3Bdocument.body.appendChild(i)%3Bi.src%3Dc.toDataURL()%3B%7D%7D)%3B%7D%7D)()
View gist:4a995452aa219e6f279ae4953e4f536c
XTENSIONS GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_half_float GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_compressed_ETC1_RGB8_texture GL_AMD_compressed_ATC_texture GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_OES_texture_compression_astc GL_OES_texture_npot GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_OES_texture_3D GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_QCOM_alpha_test GL_OES_depth24 GL_OES_packed_depth_stencil GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_EXT_sRGB GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_EXT_texture_type_2_10_10_10_REV GL_EXT_texture_sRGB_decode GL_OES_element_index_uint GL_EXT_copy_image GL_EXT_geometry_shader GL_EXT_tessellation_shader GL_OES_texture_stencil8 GL_EXT_shader_io_blocks GL_OES_shader_image_atomic GL_OES_sample_variables GL_EXT_texture_border_clamp GL_EXT_multisampled_render_to_texture GL
@toji
toji / gist:66128d27662950e335de916bccbdb1ef
Last active Apr 15, 2016
Local python server that only allows connections from localhost
View gist:66128d27662950e335de916bccbdb1ef
http() {
python -c "import BaseHTTPServer as bhs, SimpleHTTPServer as shs; bhs.HTTPServer(('127.0.0.1', $1), shs.SimpleHTTPRequestHandler).serve_forever()" &
}
(Called like: "http 8000")
View gist:0adcb83a74bf1683f8a9
### Keybase proof
I hereby claim:
* I am toji on github.
* I am toji (https://keybase.io/toji) on keybase.
* I have a public key whose fingerprint is 58B8 A064 C3EF E15A E7EA 976A 6B3C 9E34 B948 FFFC
To claim this, I am signing this object:
@toji
toji / CMWCRand.js
Created Jun 15, 2012
Simple Javascript implementation of CMWC Psuedorandom algorithm
View CMWCRand.js
// This was basically ripped straight from http://en.wikipedia.org/wiki/Multiply-with-carry, just javscriptified.
var CMWCRand = function(seed) {
var i, PHI = 0x9e3779b9;
if(!seed) { seed = Date.now(); }
var Q = this.Q = new Uint32Array(4096);
this.c = 362436;
this.i = 4095;
Q[0] = seed;
@toji
toji / triangle-collision.js
Created May 27, 2012
Javascript Swept-Sphere/Triangle Collision Detection
View triangle-collision.js
/*
* Copyright (c) 2012 Brandon Jones
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
You can’t perform that action at this time.