start new:
tmux
start new with session name:
tmux new -s myname
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
#!/bin/bash | |
sudo apt-get remove phantomjs | |
sudo unlink /usr/local/bin/phantomjs | |
sudo unlink /usr/local/share/phantomjs | |
sudo unlink /usr/bin/phantomjs | |
cd /usr/local/share |
mocha --compilers js:babel/register,js:./test/css-modules-compiler.js --recursive -w |
[Flow][] static type checker is a wonderful attempt to bring [algebric data types][] to JS. It is still fairly new project and there for has few WTFs that can pull you down the rabbit hole. This document is attempt to document things that may seem like a WTF from the perspective of JS developer who tries to employ static type checker, or in other words, some items on the list may be very subjective & based on the background of the writer.
It is very likely that one will wind up using [Polymorphic functions][] to solve a more general problem. And if you define type alias for such a function you may be puzzled what is the right syntax should be used for such type definition.
Let's start with:
var master = { | |
data: { | |
values: [1, 2, 3], | |
labels: ["one", "two", "three"], | |
food: { | |
name: "pizza" | |
}, | |
groups: [ | |
{ | |
brand: 'zillow', |
function createElement(tag, props = {}, ...children) { | |
const element = document.createElement(tag); | |
const listeners = []; | |
Object.keys(props).forEach((key) => { | |
if (key.slice(0, 2) === 'on') { | |
const event = key.slice(2).toLowerCase(); | |
element.addEventListener(event, props[key]); | |
listeners.push(() => element.removeEventListener(event, props[key])); | |
} else if (key === 'ref' && typeof props[key] === 'function') { |
import * as React from 'react'; | |
import { | |
Field as FormField, | |
InjectedFormProps, | |
reduxForm, | |
} from 'redux-form'; | |
interface CustomProps { | |
customText: string; | |
} |
final class UserData: ObservableObject { | |
@Published var image: UIImage? = nil | |
} | |
struct ContentView: View { | |
@EnvironmentObject var userData: UserData | |
@State var pickerIsActive: Bool = false | |
var body: some View { | |
NavigationView { |