Skip to content

Instantly share code, notes, and snippets.

@tyler-johnson
tyler-johnson / random_id.js
Created February 6, 2015 00:53
a random ID generator with variable length and content
var crypto = require("crypto");
var RAND_ALPHA_NUMERIC = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
module.exports = function randId(n, list) {
var id, rand_nums, i, len;
if (n == null) n = 8;
if (list == null) list = RAND_ALPHA_NUMERIC;
id = "";
@tyler-johnson
tyler-johnson / run.sh
Created May 31, 2015 21:06
Runs tar+gzip on current directory's files and streams data to s3.
find . -type f -mindepth 1 | awk -v base="./" "{ len=length(base); if (substr(\$1,1,len) == base) print substr(\$1,len+1); else print $1 }" | tar --files-from=- -cvf - | gzip -c | aws s3 cp - s3://bti-static/backup.tgz
{
"__v": 0,
"objectId": "56846e931645f4fa4cd7e06a",
"controlProvider": "NOOP",
"country": "US",
"deleted": false,
"enabled": true,
"phoneNumber": "8881234567"
}
server {
listen 80;
server_name <%= domain.name %>;
location ~* ^/[a-z0-9]+/?$ {
proxy_pass <%= domain.upstream %>;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
if (window.Selection && !Selection.prototype.extend) {
Selection.prototype.extend = function(el, offset) {
const range = document.createRange();
const anchor = document.createRange();
anchor.setStart(this.anchorNode, this.anchorOffset);
const focus = document.createRange();
focus.setStart(el, offset);
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/7.10.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'i',
1 verbose cli '@beneaththeink/pagedip-couchdb-setup',
1 verbose cli '-g',
1 verbose cli '--loglevel',
1 verbose cli 'silly' ]
2 info using [email protected]
3 info using [email protected]
@tyler-johnson
tyler-johnson / README.md
Last active July 19, 2017 18:38
setup gitlab runner for Ubuntu and Docker

Run this in Ubuntu:

bash -c "$(curl https://gist.githubusercontent.com/tyler-johnson/9edb36105861a3366812717f01e19d99/raw/gitlab-runner-setup.sh)"
@tyler-johnson
tyler-johnson / index.js
Last active October 9, 2017 22:22
Pagedip 5.2 Updated IIS Application Files
const pagedip = require('@pagedip/enterprise-edition/cli');
const config = require('./config.json');
pagedip(config);
@tyler-johnson
tyler-johnson / 0x199eD06793464a30ee3F3B2C6fB17e8dBBBE5d5f
Created October 16, 2017 06:41
0x199eD06793464a30ee3F3B2C6fB17e8dBBBE5d5f
0x199eD06793464a30ee3F3B2C6fB17e8dBBBE5d5f
Verifying my Blockstack ID is secured with the address 1NkAZVnafDrxnh7KYg7bN6RcXgv4uCK5Dk https://explorer.blockstack.org/address/1NkAZVnafDrxnh7KYg7bN6RcXgv4uCK5Dk