This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Adapted from https://www.digitalocean.com/community/articles/how-to-install-cassandra-and-run-a-single-node-cluster-on-a-ubuntu-vps | |
| USER=cassandra | |
| GROUP=cassandra | |
| mkdir ~/temp | |
| cd ~/temp | |
| wget http://www.us.apache.org/dist/cassandra/1.2.16/apache-cassandra-1.2.16-bin.tar.gz | |
| tar -xvzf apache-cassandra-1.2.16-bin.tar.gz | |
| mv apache-cassandra-1.2.16 ~/cassandra | |
| sudo mkdir /var/lib/cassandra | |
| sudo mkdir /var/log/cassandra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //noinspection ThisExpressionReferencesGlobalObjectJS | |
| (function (global) { | |
| var name = 'MyModule', | |
| short = '_m', | |
| _name = global[name], | |
| _short = (short !== undefined) ? global[short] : undefined; | |
| function Module() { | |
| /* put code in here */ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function defib(fn, space, scope) { | |
| space || (space = 1000); | |
| var queue = [], timer; | |
| function start() { | |
| if (queue.length) { | |
| var exec = queue.shift(), | |
| context = exec.context, | |
| args = exec.args; | |
| fn.apply(context, args); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>IndexedDB Tests</title> | |
| <script> | |
| function isFunction(f) { | |
| return (f && f !== null && typeof(f) === 'function'); | |
| } | |
| </script> | |
| <script src="KeyStore.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Minimalist browser name/version parsing based on data from | |
| //https://developer.mozilla.org/en-US/docs/Browser_detection_using_the_user_agent | |
| function createBrowserRegex(browser){ | |
| return new RegExp('\\b('+browser+')\\/([^\\s]+)'); | |
| } | |
| function createBrowserTest(userAgent, positive, negatives){ | |
| var matches = BROWSER_REGEX[positive].exec(userAgent); | |
| negatives=negatives||[]; | |
| if(matches && matches.length && !negatives.some(function(negative){return BROWSER_REGEX[negative].exec(userAgent)})){ | |
| return matches.slice(1,3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var iframe = document.getElementById('bannerContent_ifr') | |
| function replaceQuotes(text){ | |
| return text.replace(/(.)/g,function($1){ | |
| var c=$1.charCodeAt(0), n=$1; | |
| switch(c){ | |
| case 8220: case 8221: | |
| n='"'; | |
| break; | |
| case 8216: case 8217: | |
| n="'"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function.prototype.debounce = function (threshold, execAsap) { | |
| var func = this,timeout; | |
| return function debounced () { | |
| var obj = this, args = arguments; | |
| function delayed () { | |
| if (!execAsap) func.apply(obj, args); | |
| timeout = null; | |
| }; | |
| if (timeout) clearTimeout(timeout); | |
| else if (execAsap) func.apply(obj, args); // execute now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Array | |
| ([].indexOf)||(Array.prototype.indexOf=[].indexOf||function(a,b,c,r){for(c=this,b=b|0,r=-1;b++<c.length&&!~r;r=c[b]===a?b:r);return r}); | |
| ([].map)||(Array.prototype.map=function(a){for(var b=this,c=b.length,d=[],e=0,f;e<b;)d[e]=e in b?a.call(arguments[1],b[e],e++,b):f;return d}); | |
| ([].filter)||(Array.prototype.filter=[].filter||function(a,b,c,d,e){for(b=this,d=0,c=[];d<b.length;d++)if(a.call(b,e=b[d]))c.push(e);return c}); | |
| ([].isArray)||(Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)=='[object Array]'})); | |
| ([].every)||(Array.prototype.every=[].every||function(a,b,c,d){for(c=0,d=this;c<d.length;c++)if(!a.call(b,d[c],c,d))return!1;return!0}); | |
| ([].some)||(Array.prototype.some=[].some||function(a,b,c,d){for(c=0,d=this;c<d.length;c++)if(a.call(b,d[c],c,d))return!0;return!1}); | |
| ([].unique)||(Array.prototype.unique=function(a){return function(){return this.filter(a)}}(function(a,b,c){return c.indexOf(a,b+1)<0})); | |
| //Function | |
| Function.prototype.bind=(function(){}).bind||function(a,b){b=this;re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Doubly Linked List implementation in JavaScript | |
| * Copyright (c) 2009 Nicholas C. Zakas | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is | |
| * furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env phantomjs --web-security=false | |
| var system = require('system') | |
| , page = require('webpage').create(); | |
| var address=system.args[1]; | |
| if(address===undefined){ | |
| console.warn("USAGE: phantomjs --web-security=false cssCheck.js <http://your-site.com/index.html>") | |
| phantom.exit(); | |
| } | |
| page.onConsoleMessage = function (msg) {console.log(msg);}; |