This file contains 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 sumTransactions(lastStatementDateString) { | |
const lastStatementDate = new Date(lastStatementDateString); | |
return [ | |
'ctl00_ctl00_pagePlaceholder_sectionContent_ucTrans_gvPTV', | |
'ctl00_ctl00_pagePlaceholder_sectionContent_ucPending_gvPending', | |
] | |
.map(id => | |
Array.from(document.querySelectorAll(`#${id} tr`)) | |
.map(row => { | |
const columns = Array.from(row.querySelectorAll('td')).map( |
This file contains 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
import * as Rx from 'rxjs' | |
const pointerDown$ = Rx.Observable.race( | |
Rx.Observable.fromEvent(window, 'mousedown'), | |
Rx.Observable.fromEvent(window, 'touchstart'), | |
) | |
const drag$ = pointerDown$.flatMap(() => { | |
const pointerUp$ = Rx.Observable.race( | |
Rx.Observable.fromEvent(window, 'mouseup'), |
This file contains 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
#!/bin/bash | |
iptables -A INPUT -i docker0 -j ACCEPT | |
# Assumes host has `jq` installed | |
docker network inspect bridge | jq -r .[0].IPAM.Config[0].Gateway |
This file contains 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
#!/bin/bash | |
# Dependencies | |
# - awscli | |
# - jq | |
# Needed IAM permissions | |
# - elasticloadbalancing:DescribeInstanceHealth | |
# - elasticloadbalancing:DescribeLoadBalancers | |
# - autoscaling:DescribeAutoScalingGroups |
This file contains 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
server { | |
listen 80; | |
server_name *.domain.tld; | |
merge_slashes off; | |
location / { | |
proxy_pass http://somealternatedomain.tld; | |
} | |
} |
This file contains 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
'use strict'; | |
var _ = require('lodash'), | |
async = require('async'), | |
Bluebird = require('bluebird'), | |
mongodb = Bluebird.promisifyAll(require('mongodb')), | |
using = Bluebird.using; | |
var concurrency = 3; | |
var totalCount = 0; |
This file contains 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
Object.defineProperty(global, '__stack', { | |
get: function () { | |
var orig = Error.prepareStackTrace; | |
Error.prepareStackTrace = function(_, stack){ return stack; }; | |
var err = new Error; | |
Error.captureStackTrace(err, arguments.callee); | |
var stack = err.stack; | |
Error.prepareStackTrace = orig; | |
return stack; | |
} |
This file contains 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
#!/bin/bash | |
# http://docs.mongodb.org/ecosystem/platforms/amazon-ec2/ | |
# the following command is the updated version of the command | |
# used to setup the mongo instance along with the recommended | |
# EBS volumes | |
aws --profile <AWS_PROFILE> ec2 run-instances \ | |
--image-id <CURRENT_AWS_LINUX_AMI> \ | |
--instance-type <INSTANCE_TYPE> \ | |
--security-group-ids <SECURITY_GROUP_ID> \ |
This file contains 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
/** | |
* @name Luma | |
* @description | |
* Calculate luma, the lightness of a color between absolute black and the brightest white. | |
* | |
* @author Reed Dadoune <[email protected]> | |
* @author Alnitak http://stackoverflow.com/a/12043228/3322075 | |
* | |
* @param {float|string} | |
* - {float} r The red value of the color |
This file contains 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
#!/bin/sh | |
export PATH=/usr/local/bin:$PATH; | |
yum update | |
yum install docker -y | |
service docker start | |
# Docker login notes: | |
# - For no email, just put one blank space. | |
# - Also the private repo protocol and version are needed for docker | |
# to properly setup the .dockercfg file to work with compose |
NewerOlder