This file contains hidden or 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
| #/usr/bin/env bash | |
| # MIT © Sindre Sorhus - sindresorhus.com | |
| # forked by Gianluca Guarini | |
| changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
| check_run() { | |
| echo "$changed_files" | grep -E --quiet "$1" && eval "$2" | |
| } |
This file contains hidden or 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(document, window, undefined) { | |
| // wrap always your modules to avoid the namespace pollution | |
| // use always the strict statement | |
| 'use strict'; | |
| // you do not need to wrap all your code in an if statement... | |
| if (!document.createElement('svg').getAttributeNS) return; | |
| // shortcut to select any DOM element | |
| var $ = document.querySelectorAll.bind(document), | |
| // create an array with all the inputs to uste | |
| // BTW I am sure that this solution is neither correct but it comes from the original code logic |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # 1. Install hunspell | |
| # $ brew install hunspell | |
| # 2. Download a dictionary and install it in a path listed by `hunspell -D` | |
| # $ open http://wiki.services.openoffice.org/wiki/Dictionaries | |
| # 3. Move this file into your repository | |
| # $ mv commit-msg /path/to/repo/.git/hooks |
This file contains hidden or 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
| String.prototype.template = function (object) { | |
| // Andrea Giammarchi - WTFPL License | |
| var | |
| stringify = JSON.stringify, | |
| re = /\$\{(.*?)\}/g, | |
| evaluate = [], | |
| i = 0, | |
| m | |
| ; | |
| while (m = re.exec(this)) { |
This file contains hidden or 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
| ;(async function() { | |
| // puppeteer boilerplate code | |
| const browser = await puppeteer.launch({ | |
| args: ['--no-sandbox', '--disable-setuid-sandbox'], | |
| // notice the small device size | |
| defaultViewport: { | |
| width: 375, | |
| height: 812 | |
| } |
This file contains hidden or 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 b = require('./b') | |
| b.b = 'c' | |
| module.exports = { | |
| a: 'a' | |
| } |
This file contains hidden or 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
| <main-tag> | |
| <h1>I got the power!</h1> | |
| <h2>The answer is { answer }</h2> | |
| <script> | |
| import something from './something' | |
| this.answer = something.answer | |
| </script> | |
| </main-tag> |
This file contains hidden or 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
| /** | |
| * Advanced async (cancellable/abortable) `setTimeout` helper | |
| */ | |
| function wait(delay) { | |
| return (val) => { | |
| let timer | |
| let abort | |
| const p = new Promise(function(resolve, reject) { | |
| abort = reject |
This file contains hidden or 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 to curry any javascript method | |
| * @param {Function} fn - the target function we want to curry | |
| * @param {...[args]} acc - initial arguments | |
| * @returns {Function|*} it will return a function until the target function | |
| * will receive all its arguments | |
| */ | |
| function curry(fn, ...acc) { | |
| return (...args) => { | |
| args = [...acc, ...args] |
This file contains hidden or 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
| // forked by a script of https://github.com/nilssolanki | |
| import { add } from 'bianco.events' | |
| /** | |
| * A list of all the open overlays, tooltips, sidebars etc. | |
| * @type {Map} | |
| */ | |
| const openOverlays = new Map() | |
| /** |
NewerOlder