https://twitter.com/tjholowaychuk/status/938908368529272833 https://twitter.com/tjholowaychuk/status/876951581119229953
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' | |
const microlink = require('microlink-api') | |
const url = 'https://google.com' | |
const doRequest = microlink.createRule($ => { | |
// do whatever you want here | |
return { | |
title: $('h1'), |
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
0 info it worked if it ends with ok | |
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'i' ] | |
2 info using [email protected] | |
3 info using [email protected] | |
4 verbose npm-session ce449290ed10022f | |
5 silly install runPreinstallTopLevelLifecycles | |
6 silly preinstall [email protected] | |
7 info lifecycle [email protected]~preinstall: [email protected] | |
8 silly install loadCurrentTree | |
9 silly install readLocalPackageData |
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' | |
const microlinkAPI = require('microlink-api')('YOUR_API_KEY') | |
;(async() => { | |
const url = 'https://google.com' | |
const opts = { | |
prerender: false, | |
// You can extend the current rules or add more! |
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 styled from 'styled-components' | |
import { theme } from 'rebass' | |
const { breakpoints } = theme | |
const lastIndex = breakpoints.length - 1 | |
const getMediaBreakpoint = (breakpoints, breakpoint, index) => { | |
if (index === 0) return `@media screen and (max-width: ${breakpoint})` | |
const prevBreakpoint = breakpoints[index - 1] | |
if (index === lastIndex) { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<urlset xmlns="http://www.google.com/schemas/sitemap/0.90"> | |
<url> | |
<loc>http://www.sitemappro.com/</loc> | |
<lastmod>2018-01-27T23:55:42+01:00</lastmod> | |
<changefreq>daily</changefreq> | |
<priority>0.5</priority> | |
</url> | |
<url> | |
<loc>http://www.sitemappro.com/download.html</loc> |
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 | |
NODE_BIN=`curl -sL https://semver.io/node/resolve/8`-linux-x64 | |
echo "Downloading $NODE_BIN binary file" | |
curl -sL https://nodejs.org/dist/latest-v8.x/node-v$NODE_BIN.tar.gz | tar -xz | |
mkdir -p bin | |
mv node-v$NODE_BIN/bin/node bin/node | |
rm -rf node-v$NODE_BIN |
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' | |
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin') | |
const PurifyCSSWebpackPlugin = require('purifycss-webpack-plugin') | |
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer') | |
const ExtractTextPlugin = require('extract-text-webpack-plugin') | |
const PreloadWebpackPlugin = require('preload-webpack-plugin') | |
const HtmlWebpackPlugin = require('html-webpack-plugin') | |
const OfflinePlugin = require('offline-plugin') | |
const webpack = require('webpack') |
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
var utf8 = require('utf8'); | |
var val1 = utf8.decode('\xE2\x80\x99'); | |
const StringDecoder = require('string_decoder').StringDecoder; | |
const decoder = new StringDecoder('utf8'); | |
const symbol = new Buffer([0xE2, 0x80, 0x99]); | |
const val2 = decoder.write(symbol); | |
console.log(val1); |
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' | |
const _simpleArrayDiff = require('simple-array-diff') | |
const { map, range, random } = require('lodash') | |
const suite = require('fastbench') | |
const _hyperDiff = require('.') | |
const _range = range(0, 1000) | |
function generateRange (_range) { | |
return map(_range, () => { return { id: random(0, 100) } }) | |
} |
NewerOlder