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 | |
protected_branch='master' | |
current_branch=$(git symbolic-ref --short HEAD) | |
if [ $protected_branch = $current_branch ] | |
then | |
read -p "You should create a PR rather than push to master. Are you absolutely sure you want to proceed? [y/n]" -n 1 -r < /dev/tty | |
echo | |
if echo $REPLY | grep -E '^[Yy]$' > /dev/null |
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
/@include ([\w\-]+)\((.+)\)/ig | |
replace: $1: $2 |
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 | |
printf "\e[92mWhat would you like to call your component?\e[0m $1" | |
read NAME | |
NAME=${NAME:-$1} | |
if [ -z "$NAME" ]; then | |
printf "You must provide a component name! \n"; | |
exit 1; | |
fi |
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
<script src="/static/bundle.js"></script> |
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 path = require('path'); | |
const webpack = require('webpack'); | |
module.exports = { | |
devtool: 'cheap-module-eval-source-map', | |
entry: [ | |
'babel-polyfill', | |
'webpack-dev-server/client?http://localhost:8080', |
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 extend($obj, $ext-obj) { | |
@return map-merge($obj, $ext-obj); | |
} | |
/** | |
* Usage | |
* @method button | |
* @param {Object} $opts - options | |
* @usage | |
* |
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
/** | |
* Promise Middleware is used to avoid having to dispatch 3 events for every | |
* request (request, success and error) | |
* | |
* You can dispatch 1 event with a `promise` property and in turn the Middleware | |
* will automatically dispatch the 3 events. | |
* @method promiseMiddleware | |
* @return {Promise} returns the promise | |
*/ | |
export default function promiseMiddleware({ getState }) { |
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 add(x) { | |
var fn = (n) => add(n + x); | |
fn.toString = () => x; | |
return fn; | |
} |
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 preloadImages = (images, callback) => { | |
const loaded = []; | |
const failed = []; | |
const imageRequests = images.map(image => { | |
const img = new Image(); | |
img.src = image; | |
return new Promise((resolve) => { | |
img.onload = () => { |
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 preloadImages = (images) => Promise.all(images.map(image => | |
new Promise(resolve => { | |
const img = new Image(); | |
img.onload = () => (resolve(image)); | |
img.onerror = () => (resolve(image)); | |
img.src = image; | |
}) | |
)); |
OlderNewer