Skip to content

Instantly share code, notes, and snippets.

View Kikobeats's full-sized avatar
👋
say hi

Kiko Beats Kikobeats

👋
say hi
View GitHub Profile
@Kikobeats
Kikobeats / index.js
Created May 10, 2018 21:49
Microlink API custom rules integration
'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!
@Kikobeats
Kikobeats / gist:7ac68289bfca7494bc47fd975678da2d
Created June 5, 2018 08:50
npm ERR! asyncWrite is not a function at node@10.3.0 and npm@6.1.0
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'i' ]
2 info using npm@6.1.0
3 info using node@v10.3.0
4 verbose npm-session ce449290ed10022f
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall microlink-www@1.1.0
7 info lifecycle microlink-www@1.1.0~preinstall: microlink-www@1.1.0
8 silly install loadCurrentTree
9 silly install readLocalPackageData
@Kikobeats
Kikobeats / index.js
Created July 10, 2018 21:16
Microlink API connector
'use strict'
const microlink = require('microlink-api')
const url = 'https://google.com'
const doRequest = microlink.createRule($ => {
// do whatever you want here
return {
title: $('h1'),
@Kikobeats
Kikobeats / Hide.js
Last active February 26, 2020 17:34
Hide + rebass
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) {
@Kikobeats
Kikobeats / sitemap.xml
Last active July 10, 2023 16:19
Example Sitemap
<?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>
@Kikobeats
Kikobeats / README.md
Last active July 10, 2023 16:20
Favorite CLI programs
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);
@Kikobeats
Kikobeats / bench.js
Created January 2, 2017 22:45
hyperdiff
'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) } })
}
@Kikobeats
Kikobeats / index.js
Last active July 10, 2023 16:21
ES6 Pure & self documented Functions.
/**
* ES6 Pure & self documented Functions.
*
* Why Pure?
*
* A pure function is a function where the return value is only determined
* by its input values, without observable side effects.
*
* Why Self-documented?
*
@Kikobeats
Kikobeats / gist:9143b69d8f4963a87252
Created February 12, 2015 08:21
finder freeze when select .DS_Store, *.torrent, *.mobi,...
12/02/2015 08:54:27.693 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2
12/02/2015 08:54:27.693 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2
12/02/2015 08:54:27.693 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2