See http://stackoverflow.com/questions/35657098/add-dependency-in-webpack-plugin
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
// npm install browserify -g | |
// npm install tsd -g | |
// npm install react tsify | |
// tsd install react | |
// browserify app.tsx -p [tsify --jsx=react] -o bundle.js | |
/// <reference path="typings/react/react.d.ts" /> | |
import React = require("react"); | |
interface HelloWorldComponentProps extends React.Props<any> { |
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
NAME=$(git branch | grep '*' | sed 's/* //') | |
DESCRIPTION=$(git config branch."$NAME".description) | |
TEXT=$(cat "$1" | sed '/^#.*/d') | |
if [ -n "$TEXT" ] | |
then | |
echo "$NAME"': '$(cat "$1" | sed '/^#.*/d') > "$1" | |
if [ -n "$DESCRIPTION" ] | |
then | |
echo "" >> "$1" |
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 assertValidEmail = (value, errorMessage) => { | |
const pattern = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
if (!pattern.test(value)) { | |
throw new Error(errorMessage || translator('error.email.malformatted', { email: value})); | |
} | |
}; | |
const assertAvailableEmail = async (value) => { | |
return fetch('/validate_email', { |
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 is my workarround to create a React Story for a component which internally dispatch multiple thunk actions | |
and also retrieve info from some server. This works also on making an story in which its main component wraps another redux | |
connected components. | |
*/ | |
/** | |
BEHAVIOUR EXPLANATION | |
This component depends on an ID (fetchingDataId) which is stored in the parent component which contains many SomeComponents, so I need to mock the store before SomeComponent's story loads | |
Then, when a single SomeComponent loads, it renders two connected subcomponents which I dont have control from Storybook. And I want the story to render both components at the same time. |
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
/** | |
* Will trim the whitespace around the SVG's viewbox | |
* | |
*/ | |
var svg = document.getElementsByTagName("svg")[0]; | |
var bbox = svg.getBBox(); | |
var viewBox = [bbox.x, bbox.y, bbox.width, bbox.height].join(" "); | |
svg.setAttribute("viewBox", viewBox); |
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
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Sharing Laravel's session and checking authentication | |
|-------------------------------------------------------------------------- | |
| | |
| Use the following code in any CMS (WordPress, Joomla, etc), filemanager (CKFinder, | |
| KCFinder, simogeos's Filemanager, etc), or any other non-Laravel project to boot into | |
| the Laravel framework, with session support, and check if the user is authenticated. |
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
FROM php:7.0.4-fpm | |
RUN apt-get update && apt-get install -y libmcrypt-dev \ | |
mysql-client libmagickwand-dev --no-install-recommends \ | |
&& pecl install imagick \ | |
&& docker-php-ext-enable imagick \ | |
&& docker-php-ext-install mcrypt pdo_mysql |
OlderNewer