Skip to content

Instantly share code, notes, and snippets.

View Brocco's full-sized avatar
🥦
Livin' the dream

Mike Brocchi Brocco

🥦
Livin' the dream
View GitHub Profile
// action yml file
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
with:
args: --severity-threshold=medium --policy-path=.snyk
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
// .snyk
ignore:
@Brocco
Brocco / pixel-reduce.js
Created February 8, 2017 18:03
Organizing array of [r, g, b, a, r, g, b, a] to an object array [{r, g, b, a}, {r, g, b, a}]
const pixels = ['r','g','b','a','r','g','b','a','r','g','b','a'];
const propMap = ['r', 'g', 'b', 'a'];
const rgbas = pixels.reduce((acc, curr, i) => {
const mod = i%4;
switch (mod) {
case 0:
return [...acc, {r: curr}];
default: