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
// CountryAddressForm.js | |
// Common most used address format | |
// ... | |
render() { | |
return ( | |
<form action="#" | |
onSubmit={this.handleSubmit.bind(this)} | |
onChange={this.handleChange.bind(this)}> |
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
// CountryAddressForm.js | |
const COUNTRY_REGIONS = { IE:[], SP:[], IT:[] }; | |
render() { | |
return( | |
<form action="#" | |
onSubmit={this.handleSubmit.bind(this)} | |
onChange={this.handleChange.bind(this)}> | |
<CountrySelector name="country" countries={countries} /> |
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
// CountryAddressForm.js | |
render() { | |
return ( | |
<form action="#" | |
onSubmit={this.handleSubmit.bind(this)} | |
onChange={this.handleChange.bind(this)}> | |
<CountrySelector name="country" countries={countries} /> | |
<AddressLineInput name="address_line" value={this.state.address_line} /> |
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
// CountryAddressForm.js | |
return ( | |
<form | |
className="country-form" | |
action="#" | |
method="post" | |
onSubmit={this.handleSubmit.bind(this)} | |
onChange={this.handleChange.bind(this)}> | |
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 the common field set free of country specific things. | |
function GeneralInternationalAddress(props) { | |
return ( | |
<Fragment> | |
<AddressLineInput value={props.address_line} /> | |
<AddressLineInput | |
name="address_line2" | |
value={props.address_line2} | |
optional |
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 fibCreate() { | |
return function fibonacci(num) { | |
if (num <= 1) return 1; | |
return fibonacci(num - 1) + fibonacci(num - 2); | |
}; | |
} | |
for (var i = 0, len = 40; i < len; i++) { | |
fibCreate()(i); |
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 -l | |
set -e # fail on error | |
set -u # do not allow unset variables | |
# use the correct exit code, when piping commands, e.g. | |
# here you use curl ... | python... so if curl fails, python will still | |
# continure working | |
set -o pipefail |
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 case | |
// Render things based on the experiment variant | |
class FooTest extends Component { | |
static propTypes = { | |
children: PropTypes.node, | |
className: PropTypes.string | |
}; | |
constructor(props) { |
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
{ | |
"global": { | |
"check_for_updates_on_startup": false, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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
#!/usr/bin/env bash | |
FILEPATH="$1" | |
FILENAME="${2?"No file name provided"}" | |
if hash optipng 2>/dev/null; then | |
echo "Optmizing image" | |
cp "$FILEPATH" "$FILEPATH-bkp.png" | |
optipng -o5 "$FILEPATH" | |
else |