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
| 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
| //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
| //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
| /* | |
| takes as parameters a method and any number of static arguments. | |
| returns a function that will call the original function with these | |
| arguments, plus any new arguments given | |
| example: | |
| function pow(exponent, base){ | |
| return Math.pow(base, exponent); | |
| } | |
| var square=partial(pow, 2); |
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
| // returns things in array 'a' that are not in array 'b' | |
| // > ['a','b','c','1', '2', '3'].complement(['b', 'c', 'd', 'e']); | |
| // ['a', '1', '2', '3'] | |
| function complement(a, b){ | |
| (b)||(b=a, a=this); | |
| return (Array.isArray(a) && Array.isArray(b)) | |
| ? a.filter(function(x){return b.indexOf(x)===-1;}) | |
| : undefined; | |
| } | |
| Array.prototype.complement=complement; |
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
| sudo apt-get install linux-image-extra-$(uname -r) -y | |
| sudo apt-get install software-properties-common -y | |
| sudo add-apt-repository ppa:dotcloud/lxc-docker | |
| sudo apt-get update | |
| sudo apt-get install lxc-docker -y |
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
| alias vb="VBoxManage" | |
| alias ls='ls -GFh' | |
| export CLICOLOR=1 | |
| export LSCOLORS=ExFxBxDxCxegedabagacad | |
| fill="--- " | |
| reset_style='\[\033[00m\]' | |
| red_style='\[\033[00;31m\]' | |
| status_style=$reset_style'\[\033[0;90m\]' # gray color; use 0;37m for lighter color |
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 Y = function(ƒ) { | |
| return (function(x) { | |
| return ƒ(function λ(y) { | |
| return (x(x))(y); | |
| }); | |
| }) | |
| (function λ(x) { | |
| return ƒ(function λ(y) { | |
| return (x(x))(y); | |
| }); |
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
| # Add the Oracle JDK Repos | |
| UBUNTU_VERSION=precise | |
| echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu ${UBUNTU_VERSION} main" | tee /etc/apt/sources.list.d/webupd8team-java.list | |
| echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu ${UBUNTU_VERSION} main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list | |
| apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 | |
| DEBIAN_FRONTEND="noninteractive" apt-get update | |
| # Accept the Oracle License | |
| echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 boolean true" > /tmp/oracle-license-debconf | |
| /usr/bin/debconf-set-selections /tmp/oracle-license-debconf |