Skip to content

Instantly share code, notes, and snippets.

View amadeus's full-sized avatar
🕶️
out here livin

Amadeus Demarzi amadeus

🕶️
out here livin
View GitHub Profile
for (var key = 0, value; value = someArray[key++];) {
// value is already defined by for loop
console.log('index: ' + key, 'value: ' + value);
}
(function(){
this.Terminal = function(container, steps){
this.container = document.getElementById(container);
this.steps = steps;
this.cycle = this.cycle.bind(this);
this.cycle();
};
this.Terminal.prototype.cycle = function(){
@amadeus
amadeus / BinaryHeap.js
Created April 18, 2014 17:42
Dose Binary Heaps tho...
function BinaryHeap(scoreFunction){
this.content = [];
this.scoreFunction = scoreFunction;
}
BinaryHeap.prototype = {
push: function(element) {
this.content.push(element);
this.bubbleUp(this.content.length - 1);
/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**
* This inverts your Display Objects colors.
*
* @class InvertFilter
* @extends AbstractFilter
* @constructor
img[src$=".gif"],
img[src$=".png"] {
image-rendering: -moz-crisp-edges; /* Firefox */
image-rendering: -o-crisp-edges; /* Opera */
image-rendering: -webkit-optimize-contrast;/* Webkit (non-standard naming) */
image-rendering: crisp-edges;
-ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
}
var quickSplice = function quickSplice(arr, index){
var len = arr.length;
if (len) {
while (index < len){
arr[index++] = arr[index];
}
--arr.length;
}
};
<html>
<head>
<title>Learning WebGL &mdash; lesson 3</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="glMatrix-0.9.5.min.js"></script>
<script type="text/javascript" src="webgl-utils.js"></script>
<script id="shader-fs" type="x-shader/x-fragment">
<!DOCTYPE html>
<html>
<head>
<title>Events Example</title>
<meta name="viewport" content="width=device-width,user-scalable=no">
<style type="text/css">
html, body {
-webkit-tap-highlight-color:transparent;
-moz-tap-highlight-color:transparent;
-ms-tap-highlight-color:transparent;
let g:ctrlp_working_path_mode = 0
let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:20,results:20'
let g:ctrlp_cache_dir = $HOME.'/.vim/cache/ctrlp'
let g:ctrlp_switch_buffer = 'e'
let g:ctrlp_open_new_file = 'r'
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_max_files = 10000
let ctrlp_filter_greps = "".
" FIXME: Set these 2 lines to your preferred liking
let g:detectindent_preferred_expandtab = 0
let g:detectindent_preferred_indent = 4
let g:detectindent_max_lines_to_analyse = 1024
augroup detectindent
autocmd!
autocmd BufReadPost * :DetectIndent
augroup END