All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.
# run command in the foreground
command
# run commend in the background
alias nom='npm cache clean && rm -rf node_modules && mkdir node_modules && touch node_modules/.metadata_never_index && npm install' | |
alias bom='bower cache clean && rm -rf bower_components && mkdir bower_components && touch bower_components/.metadata_never_index && bower install' |
Just an idea, to practice after reading about redux async actions and middleware
the important part is this function
let INTERVAL = 50
let runTimer = () => {
return (dispatch, getState) => {
function mapValues(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
result[key] = fn(obj[key], key); | |
return result; | |
}, {}); | |
} | |
function pick(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
if (fn(obj[key])) { |
Why would you want to do this? Because you often don't need more. It's nice to not have to think about your "router" as this big special thing.
Instead, with this approch, your app's current pathname
is just another piece of state, just like anything else.
This also means that when doing server-side rendering of a redux app, you can just do:
var app = require('your/redux/app')
var React = require('react')
We will compare ASP.NET and Node.js for backend programming.
Source codes from examples.
This document was published on 21.09.2015 for a freelance employer. Some changes since then (14.02.2016):
async/await
. yield
and await
are used almost in the same way, so I see no point to rewrite the examples.first name | last name | age | |
---|---|---|---|
Stephen | Sugden | 31 | |
Tom | Reznik | 29 | |
Justin | Thomas | 30 |
(choose from list {"Large", "Laptop"} with prompt "Which Screen Size?") | |
set screen_size to result as text | |
set window_group to "Common" | |
if (screen_size = "Large") then | |
set window_group to "Freightlink_large" | |
end if | |
if (screen_size = "Laptop") then |