We'll use NixOps to deploy, so we need to install it
nix-env -i nixops
And to deploy on DigitalOcean we need to have an account and create an API access token for it.
var stringToCamelCase = function(string){ | |
if(typeof string !== 'string')throw "Must be string"; | |
//first character to lower case | |
string = string.charAt(0).toLowerCase() + string.slice(1); | |
//capitalize first letter after whitespace | |
return string.replace(/\s(\w)/g,function(){ | |
return arguments[1].toUpperCase(); | |
},'g'); |
#!/bin/sh | |
#automation of vsftpd installation as instructed by Justin Ellingwood @ DigitalOcean | |
#https://www.digitalocean.com/community/tutorials/how-to-configure-vsftpd-to-use-ssl-tls-on-an-ubuntu-vps | |
function pwd_prompt { | |
[ -z "$1" ] && return 1 | |
local PWD1="1" | |
local PWD2="2" |
| . . . . . . . | |
|. | |
. . . . . | |
| . | |
| . | |
. | . . . . . . . | |
| . | |
. | . . . . | |
| . . . | . | |
|. |
v | |
0 | |
v+1 p0\$\ < INTERPRETER PART + - < > . , b [ ] | |
>:~:5`#v_ $$$ 001p 00 > :0g :!#v_ :1-!#v_ :3-!#v_ :5-!#v_ :6-!#v_ :4-!#v_ :2-!#v_ :9-!#v_ :7-!#v_ :8-!#v_@ ] [ | |
$ >176*+-:#v_ 1^CHAR + + @ $ $ $ $ $ $ $ $ >$ :1 >\1-: !#v_ :0g :8-!#v_ :7-!#v_ v | |
$ v_ #: #- #1 #< 2^CHAR , 1 \ \ \ \ \ \ \ \ @ v+1\$< v_v#:-1\$< | |
>1-:#v_ 3^CHAR - \ : : : 1 : : : ^ < < $# \$< | |
>1-:#v_ 4^CHAR . ^ p1\ +1 g1:< : v_@ + 1 ~ £ 1 [ v -1<] | |
>:: #v_$ 5^CHAR < ^ p1\ -1 g1< 1 g \ g > 1+ |
/** | |
* This callback is displayed as part of the Requester class. | |
* @callback criteria~fn | |
* @param {char} c The current char | |
* @param {Object} mem An object shared between the calls | |
*/ | |
/** | |
* Reads a string into a new one, as long as some criteria is satisfied | |
* @this String | |
* @param {criteria~fn} fn function defining the criteria |
ps -eo pid,cmd | grep "[S]CRIPT_NAME" | grep -oP "^[^0-9]*\K[0-9]*" | xargs kill |
> var fTst = (v)=>((v - lomagic) & ~v & himagic)!=0; | |
himagic = 0x80808080; | |
lomagic = 0x01010101; | |
var fls = [], dt = [], a = 0x500000; | |
for(let i=0; i<20*a; i++){ | |
if(fTst(i))fls.push(i); | |
if(i%a==0)dt.push(+new Date); | |
}//00000000 | |
dt.map((v,i)=>v-dt[i-1]) | |
/** | |
* Groups values in rows | |
*/ | |
function group(vals, test, between){ | |
vals = purify(vals); | |
test = purify(test); | |
if(vals.length!=test.length) throw "Vals ("+vals.length+") and Test ("+test.length+") must be of same size"; | |
b = [-Infinity].concat( purify(between) ).concat([Infinity]); |
const Just = function(v) { | |
if(!isJust(this)) return new Just(v); | |
this.value = v; | |
Object.freeze(this); | |
}; | |
Just.prototype.bind = function(fn) { | |
let result = fn(this.value); | |
if(!isMaybe(result)) throw "Bind function not evaluating to Maybe"; | |
We'll use NixOps to deploy, so we need to install it
nix-env -i nixops
And to deploy on DigitalOcean we need to have an account and create an API access token for it.