URL | HTTP Verb | Action |
---|---|---|
/photos/ | GET | index |
/photos/new | GET | new |
/photos | POST | create |
/photos/:id | GET | show |
/photos/:id/edit | GET | edit |
/photos/:id | PATCH/PUT | update |
/photos/:id | DELETE | destroy |
-------------------------- | |
-- CORE LIBRARY IMPORTS -- | |
-------------------------- | |
import Task exposing (Task, ThreadID, andThen, sequence, succeed, spawn) | |
import Json.Decode exposing (Decoder, list, int, string, (:=), map, object2) | |
import Signal exposing (Signal, Mailbox, mailbox, send) | |
import List | |
--------------------------------- | |
-- THIRD PARTY LIBRARY IMPORTS -- |
-------------------------- | |
-- CORE LIBRARY IMPORTS -- | |
-------------------------- | |
import Json.Decode as Decode exposing (Decoder, object2, map, string, list, (:=)) | |
import Task exposing (Task, andThen, succeed, fail, onError) | |
import Signal exposing (Signal, Mailbox, mailbox, message, send) | |
import String | |
------------------------- |
data = YAML::load(File.open("config/locales/en.yml")) | |
translations = {} | |
def process_hash(translations, current_key, hash) | |
hash.each do |new_key, value| | |
combined_key = [current_key, new_key].delete_if { |k| k == '' }.join(".") | |
if value.is_a?(Hash) | |
process_hash(translations, combined_key, value) | |
else | |
translations[combined_key] = value |
After publishing my article on ECMAScript 6, some have reached out to ask how I exactly I make it all work.
I refrained from including these details on the original post because they're subject to immiment obsoletion. These tools are changing and evolving quickly, and some of these instructions are likely to become outdated in the coming months or even weeks.
When evaluating the available transpilers, I decided to use 6to5, which has recently been renamed to Babel. I chose it based on:
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
# Create multiple folders | |
$ mkdir -p source/tags/modules/{dob,grid,radio,set,telephone,text} | |
# Move multiple files by wildcard pattern | |
$ mmv "source/tags/modules/*.txt" "source/tags/modules/#1/#1.txt" | |
# Create multiple files by wildcard pattern (e.g. same name as their folder) | |
$ cd source/tags/modules | |
# then... |
Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets
“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important
or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”
You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?
# Install postgres first (e.g. OS X): | |
brew install postgres | |
# After installation... if user not created: | |
# This is a wrapper around CREATE ROLE, you might not have it. | |
# BTW, a role is the same as a user. | |
# A role is an entity that can own database objects and have database privileges; | |
# a role can be considered a "user", a "group", or both depending on how it is used. | |
createuser --superuser postgres # -s works as well |