Skip to content

Instantly share code, notes, and snippets.

const MongoClient = require("mongodb").MongoClient;
const tracer = require("dd-trace").init();
const StatsD = require("hot-shots");
const dogstatsd = new StatsD();
function getRandomInt(max, skews = 1) {
let result = max;
for (let i = 0; i < skews; i++) {
const MongoClient = require("mongodb").MongoClient;
const tracer = require("dd-trace").init();
const StatsD = require("hot-shots");
const dogstatsd = new StatsD();
function getRandomInt(max, skews = 1) {
let result = max;
for (let i = 0; i < skews; i++) {
@adambankin
adambankin / seed.js
Last active March 2, 2021 00:58
Node script for writing fake server data
const fs = require("fs");
// create a file writer that OVERWRITES the content of the text file
fs.writeFileSync("seed2.log", "")
function getRandomInt (max, skews = 1) {
let result = max;
for (let i = 0; i < skews; i++) {
result = Math.random() * result;
@adambankin
adambankin / darkmode.sh
Last active January 16, 2019 20:42
Add dark mode to slack
#!/usr/bin/env bash
FILEPATH="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js"
IFS='' read -r -d '' DARKMODE_CODE <<"EOF"
//darkmode BEGIN
document.addEventListener('DOMContentLoaded', function() {
const css = `
body { background: #222; color: #e6e6e6; }
a { color: #949494; }
@adambankin
adambankin / this.js
Created November 21, 2018 21:54
Using `this` with destructuring
function Item ({ name, id }) {
this.id = id;
this.name = name;
}
Item.prototype.getName = function () {
return this.name;
};
function checkThis1 ({ getName }) {
function setupDomElement () {
parentNode.innerHTML = '<dom-element></dom-element>';
parentNode.find('dom-element').addEventListener('click', () => {console.log('blah')});
}
setupDomElement();
setupDomElement();
@adambankin
adambankin / post.js
Created October 16, 2018 17:34
post.js
$(document).ready(function() {
//link to T1
$('#t1Logo').on('click', () =>{
window.location.href='https://t1.mediamath.com/app/#monitor';
})
$('#title').on('click', () =>{
window.location.href='/';
})
//connect the api to the ids
var currentDevice = '';
@adambankin
adambankin / JQL.txt
Created May 18, 2018 17:45
Filtering by date in JIRA with JQL
status WAS "Done" BY alale DURING ("2017/04/01", "2017/06/30") ORDER BY resolved ASC
• What team are you in?
Campaigns
• Is your current release process CI/CD?
We have three deployables: Nemo (Perl), Adama (Perl) and Compass (front end). None are CI/CD
• (If so)What parts are CI/CD and what parts need to change?
-
• (If not)How does your team currently release code into production?
var http = require('http');
var url = require('url');
var querystring = require('querystring');
var stores = [191, 192, 193, 194, 195, 15173, 15171, 15174];
var opts = url.parse('http://www.istocknow.com/live/live.php?type=7Plus&operator=simfree&color=Black&model=128GB&ajax=1&nocache=1476915136992&nobb=false&notarget=false&noradioshack=false&nostock=false');
opts.headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36"
};