- Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
- pathname - The "file/directory" portion of the URL, like
invoices/123
- search - The stuff after
?
in a URL like/assignments?showGrades=1
. - query - A parsed version of search, usually an object but not a standard browser feature.
- hash - The
#
portion of the URL. This is not available to servers inrequest.url
so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things. - state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
- pathname - The "file/directory" portion of the URL, like
https://twitter.com/snookca/status/1073299331262889984?s=21
“In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”
Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows.
(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)
So the big deal about css-in-js (cij) is selectors.
import React, { PropTypes, Component } from 'react' | |
import { getRef, listToArray } from '../utils/firebase' | |
import { ErrorMessage, Loading } from '../Theme' | |
/* | |
```js | |
<Ref path="/somewhere"> | |
{({ error, loaded, value }) => ( | |
// `value` is an object w/ keys |
import { Component } from 'react' | |
import { createStore, combineReducers } from 'redux' | |
import parseLinkHeader from 'parse-link-header' | |
const START = 'start' | |
const SUCCEED = 'succeed' | |
const ERROR = 'error' | |
const inflight = (state={}, action) => ( | |
((state) => ( |
-
brew install gnupg, pinentry-mac
(this includes gpg-agent and pinentry) -
Generate a key:
$ gpg --gen-key
-
Take the defaults. Whatevs
-
Tell gpg-agent to use pinentry-mac:
$ vim ~/.gnupg/gpg-agent.conf
This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
<!doctype html> | |
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
<html> | |
<head> | |
<title>iOS 8 web app</title> | |
<!-- CONFIGURATION --> |
# Adjust the line that says Dir.chdir so it points to the path where your | |
# JavaScripts are stored. | |
# | |
# Usage: | |
# Instead of linking scripts one by one with <script> tags, as in: | |
# <script src="/js/jquery-1.5.2.min.js"></script> | |
# <script src="/js/underscore.js"></script> | |
# <script src="/js/backbone-min.js"></script> | |
# | |
# You can now go: |
<!DOCTYPE html> | |
<head> | |
<title>Snow</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> | |
<script src="snow.js" type="text/javascript"/></script> | |
</head> | |
<body onload="init();"> | |
<canvas id="bgcanvas" width="410" height="316" style="position:absolute;z-index:2"></canvas> | |
<img src="globe_layers_2.png" style="position:absolute;z-index:3"> | |
<canvas id="fgcanvas" width="410" height="316" style="position:absolute;z-index:4"></canvas> |