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
import React, { PropTypes, Component, Children, cloneElement } from 'react'; | |
export default class Fullscreen extends Component { | |
static propTypes = { | |
children: PropTypes.node | |
}; | |
state = { | |
width: 0, | |
height: 0 |
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
import { Schema, arrayOf, normalize } from "normalizr" | |
const input = { | |
id: 100, | |
title: 'Playing with normalizr', | |
text: 'Normalize deep nested query with normalizr', | |
likes: { | |
total: 1, | |
page: 1, | |
limit: 10, |
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
javascript:(function(){ window.open('https://hangouts.google.com/start'); })(); |
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
import React from 'react'; | |
import { Field } from 'redux-form'; | |
export default function FormField(props) { | |
const { component: Component, ...rest } = props; | |
const renderField = (field) => { | |
const { input, ...other } = field; | |
return ( | |
<Component {...input} {...other} /> | |
); |
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
import { combineEntitiesReducers } from 'redux-entities'; | |
import messages from './messages'; | |
import tickets from './tickets'; | |
export default combineEntitiesReducers({ | |
messages, | |
tickets | |
}); |
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
// Based on http://en.wikipedia.org/wiki/Bank_card_number#Issuer_identification_number | |
// Card names used from tipsi-stripe. | |
const brandAmericanExpress = { | |
name: 'American Express', | |
prefixes: ['34', '37'], | |
} | |
const brandDiscover = { | |
name: 'Discover', | |
prefixes: ['60', '62', '64', '65'], | |
} |
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
version: '3' | |
services: | |
vpn: | |
image: hwdsl2/ipsec-vpn-server | |
privileged: true | |
restart: always | |
volumes: | |
- /lib/modules:/lib/modules:ro | |
ports: | |
- 500:500/udp |
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
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
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 example shows the difference | |
// between classNames, classNames/bind and classnames-loader | |
// submit-button.css | |
/* | |
:local .className { | |
color: green; | |
background: red; | |
} |
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 XIAOMI_STRUCT_ATTR = { id: 65281, type: 'charStr' } | |
const XIAOMI_STRUCT_OLD_ATTR = { id: 65282, type: 'charStr' } | |
const XIAOMI_MULTICLICK_ATTR = { id: 32768, type: 'boolean' } | |
const XIAOMI_PRESSURE_ATTR = { id: 16, type: 'int16' } | |
function parseXiaomiStruct(rawData) { | |
const buffer = new Buffer(rawData, 'ascii') | |
const data = {} | |
let index = 0 | |
while (index < buffer.length) { |
OlderNewer