NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.
- Each line is a valid JSON value
- Line separator is ‘\n’
cat test.json | jq -c '.[]' > testNDJSON.json
/* | |
Since late 2020, Netlify has put up a pay wall on its built-in Slack notifications for CI/CD. | |
This gist shows you a workaround using the still-free Netlify's deploy webhook that triggers a Netlify Function calling Slack Incoming Webhook. | |
Steps: | |
1. Deploy this Netlify Function | |
2. Have the corresponding link pasted into Netlify's deploy webhook, i.e. https://example.com/.netlify/functions/<your-function> | |
3. In next deploy, Netlify will trigger the deploy webhook, which in turn calls your Slack Incoming Webhook | |
*/ |
NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.
cat test.json | jq -c '.[]' > testNDJSON.json
function ProviderComposer({ contexts, children }) { | |
return contexts.reduceRight( | |
(kids, parent) => | |
React.cloneElement(parent, { | |
children: kids, | |
}), | |
children | |
); | |
} |
/* | |
* Email validator | |
* By Wallace Sidhrée - @dreamyguy | |
*/ | |
const validateEmail = value => { | |
if (value) { | |
// Emails longer than 256 chars aren't valid | |
if (value.length > 256) { | |
return false; | |
} |
{ | |
"emojis": [ | |
{"emoji": "👩👩👧👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👧👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👦👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👨👩👧👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z |
Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex
command line tool.
To learn more about migrations, check out this article on the different types of database migrations!
import React from 'react' | |
import { BrowserRouter as Router, Switch } from 'react-router-dom' | |
import routes from './routes' | |
import FancyRoute from './components/tools/FancyRoute' | |
const App = props => | |
<Router> | |
<Switch> | |
{routes.map((route, i) => | |
<FancyRoute key={i} {...route} /> |
/* =================================== | |
* Vertical spacing for Zurb Foundation Grid | |
* | |
* Copyright (c) 2017, Wallace Sidhrée | |
* MIT License | |
====================================== */ | |
$vs-positions: top bottom; | |
$vs-total: 8 !default; // range of classes to be created (in this case 1-8) | |
$vs: $gutter-size-half; |
/** | |
* Calculate brightness value by RGB or HEX color. | |
* @param color (String) The color value in RGB or HEX (for example: #000000 || #000 || rgb(0,0,0) || rgba(0,0,0,0)) | |
* @returns (Number) The brightness value (dark) 0 ... 255 (light) | |
*/ | |
function brightnessByColor (color) { | |
var color = "" + color, isHEX = color.indexOf("#") == 0, isRGB = color.indexOf("rgb") == 0; | |
if (isHEX) { | |
var m = color.substr(1).match(color.length == 7 ? /(\S{2})/g : /(\S{1})/g); | |
if (m) var r = parseInt(m[0], 16), g = parseInt(m[1], 16), b = parseInt(m[2], 16); |