This file contains hidden or 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
componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | |
var pickList = nextProps.pickList; | |
var code = nextProps.code; | |
var newValue = nextProps.value; | |
var value = this._getValueFromCode(code, pickList); | |
if ('' === value && newValue) { | |
value = newValue; | |
} | |
this.setState({ value: value }); | |
this._awesomeplete._list = this._extractListFromData(pickList); |
This file contains hidden or 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 Autocomplete = { | |
/** | |
* Component will mount. | |
* Check if the Awesomplete library is in the Window object. | |
*/ | |
componentWillMount: function componentWillMount() { | |
// Check if Awesomplete is set in Window | |
if (!window.Awesomplete) { | |
throw new Error('Please include Awesomplete to your application. See http://leaverou.github.io/awesomplete/ for more information'); | |
} |
This file contains hidden or 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 | |
SSID=$(iwgetid -r) | |
PROXY="http://172.20.0.9:3128" | |
if [ "Klee" = "$SSID" ] | |
then | |
su stan -c "dbus-launch gsettings set org.gnome.system.proxy mode 'manual'" | |
rm /home/stan/.atom/.apmrc |
This file contains hidden or 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
# Windows related mounts | |
UUID=74E0BAE0E0BAA82E /media/windows ntfs uid=1000,gid=1000,dmask=023,fmask=006,exec 0 2 | |
UUID=7C5CBE535CBE0842 /media/data ntfs uid=1000,gid=1000,dmask=023,fmask=006,exec 0 2 |
This file contains hidden or 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
{ | |
"A": [ | |
[0,0,0,0,0,0,0], | |
[0,0,0,1,0,0,0], | |
[0,0,1,0,1,0,0], | |
[0,0,1,0,1,0,0], | |
[0,1,0,0,0,1,0], | |
[0,1,1,1,1,1,0], | |
[0,1,0,0,0,1,0], | |
[1,0,0,0,0,0,1] |
This file contains hidden or 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 React from 'react'; | |
import TextInput from './TextInput'; | |
const TodoItem = ({text}) => ( | |
<li className="todo"> | |
<div className="view"> | |
<input type="checkbox" className="toggle" /> | |
<label htmlFor="todo"> | |
{text} |
This file contains hidden or 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 Firebase from 'firebase'; | |
const firebaseRef = new Firebase('https://squanalytics.firebaseio.com'); | |
const pointsRef = firebaseRef.child('points'); | |
const stanPointsRef = pointsRef.child('stan'); | |
const arthurPointsRef = pointsRef.child('arthur'); | |
export default async function (hook) { | |
const currentTime = new Date(); |
As a frontend Javascript developer, managing your source files can quickly get tricky.
If Node has a built-in module resolver —require
— there is no built-in module resolver in the browsers.
In this article, I will get you started with Webpack, a very powerful tool to organize, compile and package your source files. Webpack is an asset manager that will let you compile, optimize, minify all your files: Javascript, CSS, pictures...
Instead of presenting a Webpack boilerplate or starter kit, I will show you how to build a web application step by step from scratch, so that you will end up with a fully working solution that you are comfortable coding with.
This file contains hidden or 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 React, {PropTypes} from 'react'; | |
import ProductCard from '../../molecule/product-card'; | |
import PromoCode from '../../atom/promo-code'; | |
import PaymentForm from '../../molecule/payment-form'; | |
import style from './style.css'; | |
const Cart = ({ | |
productCardProps, | |
promoCodeProps, |