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
export const and = (func, ...funcs) => (...args) => ( | |
funcs.length | |
? func(...args) && and(...funcs)(...args) | |
: func(...args) | |
); | |
export const or = (func, ...funcs) => (...args) => ( | |
funcs.length | |
? func(...args) || or(...funcs)(...args) | |
: func(...args) |
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' | |
exports.handlers = { | |
symbolFound: function (e) { | |
let params = e.code.paramnames | |
let filename = e.filename.split('doc-stage/')[1].split('.js')[0] | |
if (filename === 'module.exports' || filename === 'exports') { | |
return | |
} | |
let type = e.astnode.type | |
if (type === 'Property') { |
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 | |
# OS X Android icon resizer | |
# Resizes icon and puts in corresponding folders | |
# Usage: android-resizer [image path] [mdpi size] [out dir] | |
# If no out directory supplied, uses directory from image path | |
if [[ $# -lt 2 ]] | |
then | |
echo "Error: Please supply image file path and mdpi size" |
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
// v2: more similar to render functions used by React, Vue, etc | |
// Example usage: | |
create('div', [ | |
['h1', { 'class': 'foo' }, 'Bar'], | |
['p', 'Lorem ipsum dolor'] | |
]) | |
// OR | |
create('div', [ | |
create('h1', { 'class': 'foo' }, 'Bar'), |
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
function injectPage(url) { | |
var CONTAINER_SELECTOR = '.content'; | |
//Show loading indicator | |
document.querySelector(CONTAINER_SELECTOR).innerHTML = '<center>Loading...</center>'; | |
url = decodeURI(url); | |
var xhr = new XMLHttpRequest(); |
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
/** | |
Structure used: | |
Source files are in /app | |
There are php files in /app/private_php and /app/public_php | |
Static files (elements, bower_components) are in /app/static | |
Builds into /dist-dev and /dist-prod | |
*/ | |
var gulp = require('gulp'); |
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 | |
# OS X Android icon resizer | |
# Resizes icon and puts in corresponding folders | |
# Usage: android-icon-resizer [image path] [mdpi size] [out dir] | |
# If no out directory supplied, uses directory from image path | |
if [[ $# -lt 2 ]] | |
then | |
echo "Usage: android-icon-resizer [image path] [mdpi size] [out dir]" |