Skip to content

Instantly share code, notes, and snippets.

@ztdgz
ztdgz / bootstrapalert.js
Last active October 21, 2016 00:34
basic bootstrap alert dialog display thingy. It makes it easy to display a message or dialog to a user.
// This is a basic bootstrap alert dialog display thingy.
// It makes it easy to display a message or dialog to a user.
// I don't like jQuery, so I only used it where bootstrap needs it. Someone could probably clean this up slightly
// but I'd only recommend that if it reduces the amount of code used...
// I've added another file to this gist with some calling demonstrations.
// So, obviously, you'll need to include bootstrap and jquery in your awesome page...
bsalert = function() {
var E = function(){return document.createElement(arguments[0]);};
function setordefault(it, value) {
if(typeof value === 'undefined' || value == null) return it; //default
@ztdgz
ztdgz / mandelbrot.js
Last active December 15, 2015 03:19
Mandelbrot thingy JS.
function ms(){
var C = document.createElement('canvas'), g;
g = C.getContext('2d');
C.setAttribute('style',
'margin:30px;box-shadow: 4px 7px 28px rgba(0,0,0,0.5)');
C.width=640; C.height=480;
document.body.appendChild(C);
var lR=-2.2,hR=1.2,lI=-1.3,y=0,x=0,n=0,w=C.width,h=C.height,
cim,cre,Zre,ZimZim2,ii,zre2,f=Math.floor,d=30;
var hI=lI+(hR-lR)*h/w,rF=(hR-lR)/(w-1),iF=(hI-lI)/(h-1),
@ztdgz
ztdgz / redshirt.js
Created October 23, 2012 00:44
Upink game data "decryption" - "redshirt" processor, in JavaScript.
/*******************
I think the drag and drop code in here was mostly copy-pasted
from http://www.html5rocks.com/en/tutorials/file/dndfiles/
I don't know if I changed it, or if I messed around with it...
It may or may not work in your browser, so make changes
and share if you need to.
-Mike
-- what's it do?