Python:
import <module>
from <module> import defaultMember
from <module> import *
import <module> as <name>
/* | |
This is obviously a very basic example. It takes props to render the inputs with their values, and | |
to render any error state. It also takes props to update the state, or submit the form. | |
*/ | |
const LoginForm = props => ( | |
<form onSubmit={props.onSubmit}> | |
<input type="text" name="username" onChange={props.onChangeUsername} value={props.username}/> | |
{ props.userNameError && <span class="error">{ props.usernameError }</span> } | |
<input type="password" name="password" onChange={props.onChangePassword} value={props.password}/> |
This is an example of a socket-activated per-connection service (which is usually referred to as inetd-like service). A thorough explanation can be found at http://0pointer.de/blog/projects/inetd.html.
The key point here is to specify Accept=yes
, which will make the socket accept connections (behaving like inetd) and pass
only the resulting connection socket to the service handler.
#!/usr/bin/env bash | |
# | |
# gh-dl-release! It works! | |
# | |
# This script downloads an asset from latest or specific Github release of a | |
# private repo. Feel free to extract more of the variables into command line | |
# parameters. | |
# | |
# PREREQUISITES | |
# |
// Mutative | |
company.users.push({ name: 'New User' }); | |
return company; | |
// Immutable | |
return { ...company, users: [ ...company.users, { name: 'New User' } ] }; | |
// Implicit identifier |
[Unit] | |
Description=Keeps a tunnel to 'remote.example.com' open | |
After=network.target | |
[Service] | |
User=autossh | |
# -p [PORT] | |
# -l [user] | |
# -M 0 --> no monitoring | |
# -N Just open the connection and do nothing (not interactive) |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
""" | |
Configuration Parser | |
Configurable parser that will parse config files, environment variables, | |
keyring, and command-line arguments. | |
Example test.ini file: |
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
if [[ ${#} -ne 1 ]] | |
then | |
echo "Usage: ${0} upstart-conf-file" >&2 | |
exit 1 | |
fi |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require "./fabric_provisioner.rb" | |
Vagrant::Config.run do |config| | |
# snip | |
config.vm.provision Vagrant::Provisioners::Fabric do |fab| |