View helpers
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 axios from 'axios' | |
import winston from 'winston'; | |
export const logger = winston.createLogger({ | |
format: winston.format.json(), | |
transports: [new winston.transports.Console()], | |
}); | |
export const snsClientBuilder = (token) => { | |
const client = axios.create({ |
View distribution.js
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
const managers = [ | |
{ name: "Manager 1", weight: 0.6, tasks: 0 }, | |
{ name: "Manager 2", weight: 0.2, tasks: 0 }, | |
{ name: "Manager 3", weight: 0.1, tasks: 0 }, | |
{ name: "Manager 4", weight: 0.1, tasks: 0 } | |
]; | |
// Create a cumulative weight array | |
let cumWeight = 0; | |
for (let i = 0; i < managers.length; i++) { |
View amazon-aws-cli-install-7z.sh
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
yum update -y && amazon-linux-extras install epel -y && yum install p7zip -y |
View Fluid font size
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 | |
// .className | |
// @include fluidFontSize(12, 60, 320, 1440) | |
// | |
@function calcFluidFontSize($f-min, $f-max, $v-min, $v-max) | |
$k: ($f-max - $f-min)/($v-max - $v-min) | |
$b: $f-min - $k * $v-min | |
$b: $b * 1px | |
@return calc( #{$k} * 100vw + #{$b} ) |
View arrayShuffle.txt
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 shuffleArray(array) { | |
for (let i = array.length - 1; i > 0; i--) { | |
const j = Math.floor(Math.random() * (i + 1)); | |
[array[i], array[j]] = [array[j], array[i]]; | |
} | |
} |