form jQuery:
<div class="bingo">
<button>Say hi!</button>
</div>
<script>
$('button').on('click', function () {
console.log('hi')
form jQuery:
<div class="bingo">
<button>Say hi!</button>
</div>
<script>
$('button').on('click', function () {
console.log('hi')
upstream php { | |
server unix:/var/run/php5-fpm.sock; | |
} | |
server { | |
# enforce NO www | |
server_name www.example.com; | |
return 301 $scheme://example.com$request_uri; | |
} |
#! /usr/bin/env bash | |
# Usage: git-io URL [CODE] | |
# | |
# Turns a github.com URL | |
# into a git.io URL | |
URL="$1" | |
CODE="$2" |
@mixin stroke($width, $color) { | |
$shadow: 0 0 0 transparent; | |
$i: 0; | |
@while ($i < $width) { | |
$i: $i + 1; | |
$j: 0; | |
@while ($j < 2) { | |
$j: $j + 1; |
Can't share the complete code because the app's closed source and still in stealth mode, but here's how I'm using React Router and Redux in a large app with server rendering and code splitting on routes.
addReducers()
callback available to the getComponents()
method of
each React Router route. Each route is responsible for adding any Redux
reducers it needs when it's loaded. (This isn't really necessary on theFirst of all, this is not my brilliant effort to get react-native working on Windows, it is the collation of work by others, particularly @mqli and @Bernd Wessels. I've just summarised what worked for me.
If you would prefer to read what I've plagerised, head over to mqli's great gist
react-native-cli 0.1.5
, react-native 0.12.0
on Windows 10, node 4.1.1, and Android (physical Nexus 6 and AVD with API v22)Keep this github issue handy, it’s the bucket for all Windows/Linux related tricks to get RN working.
/** | |
* Write JSX, but make sure you have `import html from 'htm/preact'` in your files. | |
* Run them through this horrid attrocity and get JSX support with basically no overhead. | |
*/ | |
export function transformJsxToHtm(code) { | |
const tokenizer = /(^|)(?:<\/([a-z$_][a-z0-9_.-:]*)>|<([a-z$_][a-z0-9_.-:]*)(\s+[a-z0-9._-]+(?:=(?:".*?"|'.*?'|\{.+?\}))?)*(\s*\/\s*)?>|<(\/?)>)/gi; | |
let out='', index=0, token; | |
let depth = 0; | |
let stacks = []; | |
let shouldPop = false; |