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
// takes a {} object and returns a FormData object | |
var objectToFormData = function(obj, form, namespace) { | |
var fd = form || new FormData(); | |
var formKey; | |
for(var property in obj) { | |
if(obj.hasOwnProperty(property)) { | |
if(namespace) { |
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 axios from 'axios' | |
const MAX_REQUESTS_COUNT = 5 | |
const INTERVAL_MS = 10 | |
let PENDING_REQUESTS = 0 | |
// create new axios instance | |
const api = axios.create({}) | |
/** |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
# Adding include/exclude rules to CQ/AEM package filters through cURL. | |
# Through a simple search, you will find numerous lists of CQ/AEM cURL commands. | |
# However, I haven't seen an example of adding rules to package filters. The | |
# JSON "rules" key takes an array value. You can leave the array empty if you | |
# don't need to include any rules. The array is of JSON objects with a | |
# "modifier" key and value of "include" or "exclude", and a "pattern" key with | |
# your path or regular expression as the value. | |
# create package |
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
# | |
# This script converts margins, padding, and borders to logical values, | |
# allowing RTL and vertical languages to show correctly. | |
# Supports both *.css and *.scss files. | |
# | |
# Some renames are not yet implemented widely, and may require CSS plugin | |
# https://github.com/csstools/postcss-logical | |
# They have been commented out for now, but feel free to try them out. | |
# | |
# Full spec: https://drafts.csswg.org/css-logical/ |
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 gulp = require('gulp'); | |
var myTransform = require('./myTransform'); | |
gulp.task('foobar', function (){ | |
return gulp.src("foobar.js") | |
.pipe(myTransform()) | |
.pipe(gulp.dest('.')); | |
}); |
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
const arr1 = [1,2,3] | |
const arr2 = [4,5,6] | |
const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6] |
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
window.AudioContext = window.AudioContext || window.webkitAudioContext; | |
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia; | |
window.addEventListener('load', init, false); | |
function init () { | |
try { | |
record(new AudioContext()); | |
} | |
catch (e) { |
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
// Make sure you have json-summary as a coverage reporter in your jest config. | |
// coverageReporters: ['json-summary', 'text', 'lcov'] | |
import { readFileSync, mkdirSync, writeFileSync } from 'fs' | |
import { join } from 'path' | |
import { get } from 'https' | |
import { ok } from 'assert' | |
Promise.resolve().then(async () => { | |
const outputDir = join(process.cwd(), 'badges') |
NewerOlder