Skip to content

Instantly share code, notes, and snippets.

View cliftonc's full-sized avatar

Clifton Cunningham cliftonc

View GitHub Profile
{
"views": [
[1, 0, 16, 7, 7, 8, 4],
[1, 1, 0, 1, 0, 12, 26],
[14, 51, 35, 44, 23, 47, 35],
[4, 2, 2, 1, 3, 5, 9],
[2, 1, 9, 4, 1, 3, 4],
[6, 3, 10, 6, 1, 4, 5],
[1, 1, 5, 1, 2, 4, 10],
[5, 4, 4, 2, 6, 10, 15],
@cliftonc
cliftonc / theme.js
Created September 13, 2015 12:28
Theme.js assuming using npm install of themese
'use strict';
import when from 'when';
import Path from 'path';
import _ from 'lodash';
import File from 'fs-extra';
import fs from 'fs';
import del from 'del';
import 'source-map-support/register';
import elegantSpinner from 'elegant-spinner';
import logUpdate from 'log-update';
@cliftonc
cliftonc / adyen.js
Created November 9, 2015 09:48
Example Adyen NodeJS
'use strict';
var request = require('superagent');
var flat = require('flat');
var _ = require('lodash');
var debug = require('debug')('payment-gateway:adyen');
var unflatten = flat.unflatten;
var errorMessageSplitter = /^(\S+)\s(\d{3})\s(.+)$/;
@cliftonc
cliftonc / keybase.md
Created March 15, 2016 15:36
keybase.md

Keybase proof

I hereby claim:

  • I am cliftonc on github.
  • I am cliftonc (https://keybase.io/cliftonc) on keybase.
  • I have a public key whose fingerprint is 30FD 5B7A 8673 F0BD 5A61 2E42 7222 59F1 20F9 A7E1

To claim this, I am signing this object:

@cliftonc
cliftonc / rd.js
Last active May 29, 2016 11:00
Load to redis
var _ = require('lodash');
var fs = require('fs');
var path = require('path');
var written = 0;
var redis = require('redis');
var client = redis.createClient();
var stream = require('stream');
var util = require('util');
function encode1(key) {
@cliftonc
cliftonc / cassandra.js
Last active May 30, 2016 19:31
Cassandra version
//select * from downloads.downloads where user = 3626249 and resource IN (6109933,123,6326144);
var _ = require('lodash');
var async = require('async');
var fs = require('fs');
var path = require('path');
var written = 0;
var stream = require('stream');
var util = require('util');
const cassandra = require('cassandra-driver');
@cliftonc
cliftonc / blah.js
Last active June 8, 2016 20:10
bhlha
import axios from 'axios';
import endpoints from 'module-tsl-endpoints';
import environment from 'module-tsl-environment';
const registrationBaseUrl = endpoints.getSync('registration', environment);
const headers = (config) => ({
Accept: 'application/json',
contentType: 'application/json',
'x-tslauthapp': `${config.id}:${config.secret}` });
@cliftonc
cliftonc / sinopia.yaml
Created September 29, 2016 12:49
sinopia
#
# This is the default config file. It allows all users to do anything,
# so don't use it on production systems.
#
# Look here for more config file examples:
# https://github.com/rlidwka/sinopia/tree/master/conf
#
# path to a directory with all packages
storage: /Users/ccunningham/.local/share/sinopia/storage

Checklist

  • Ensure you have latest docker images for everything before starting.
  • Ensure you have given docker sufficient ram and cpu (8gb / 6) works for me.
  • Ensure you have the latest bosco.
  • Ensure any services you depend on have all references to databases and other services via local.tescloud.com. If you see localhost then it won't work in a container.
  • Ensure any services have a default worker config of 1 worker (most have 2). This reduces local memory usage further.
  • bosco morning your team.
  • Go into the app you want to work on, I use three console tabs:
  • bosco run -d - starts all dependencies of current service, I typically then switch this tab to a pm2 logs output.
@cliftonc
cliftonc / vwo.js
Created July 5, 2017 14:36
maurizio
var _vis_opt_heatmap = 0;if(!_vwo_code.finished() || _vis_opt_heatmap){clearTimeout(_vwo_settings_timer);
if(_vis_opt_heatmap && !document.getElementById('_vis_opt_path_hides')){var a=document.createElement('style');a.setAttribute('id','_vis_opt_path_hides');a.setAttribute('type','text/css');document.getElementsByTagName('head')[0].appendChild(a);}
var _vwo_acc_id=265077,_vwo_exp_ids=[],_vwo_exp={},_vwo_cookieDomain='tes.com';
_vwo_exp_ids.push('30');
_vwo_exp['30'] = {};
_vwo_exp['30'].name = "Clifton Test if it works";
_vwo_exp['30'].version = 2;
_vwo_exp['30'].clickmap = 0;
_vwo_exp['30'].type = 'VISUAL_AB';
_vwo_exp['30'].status = 'NOT_STARTED';