Adopted November 15, 2011 Effective March 1, 2012
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Redux do | |
| @moduledoc """ | |
| Like redux.js, but more elixir-like | |
| store = create_store fn state, action -> ... end | |
| store |> get_state() | |
| store |> dispatch(%{ type: "publish" }) | |
| """ | |
| defstruct reducer: nil, state: nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Store do | |
| @initializer_action %{type: "@@INIT"} | |
| # Code your Mom calls | |
| def start_link(reducer, initial_state \\ nil) do | |
| GenServer.start_link(__MODULE__, [reducer, initial_state]) | |
| end | |
| def get_state(store) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pip install redis | |
| # pip install hiredis | |
| # pip install python-dotenv | |
| import os | |
| from os.path import join, dirname | |
| from dotenv import load_dotenv | |
| import redis | |
| import json | |
| import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express'); | |
| var graphqlHTTP = require('express-graphql'); | |
| // var GraphQLJSON = require('graphql-type-json'); | |
| var { buildSchema } = require('graphql'); | |
| var schema = buildSchema(` | |
| # Temporary placeholder type for development. | |
| scalar TBD | |
| # A JSON Web Token string. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsupport.hp.com%2Fus-en%2Fdrivers%2Fselfservice%2Fswdetails%2Fhp-l7014t-14-inch-retail-touch-monitor%2F10691869%2FswItemId%2Fvc-170706-1&data=02%7C01%7Cben.damman%40state.ca.gov%7C5ce2c3e2a8564bbddd3108d4d45f5d72%7C52b26be47f5d4e1cbaed8cf75b7570d5%7C1%7C0%7C636366953441362889&sdata=rWJ1t6HVIjYMLCmANBuXb67LMrtr9otQyF11ViYtl5E%3D&reserved=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Keybase proof | |
| I hereby claim: | |
| * I am typesend on github. | |
| * I am typesend (https://keybase.io/typesend) on keybase. | |
| * I have a public key whose fingerprint is 38B6 37EC 2568 54C4 2AD5 FCF1 0A5D DBE0 F1D9 C113 | |
| To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def self.import(file) | |
| CSV.foreach(file.path, headers: true) do |row| | |
| house = find_or_initialize_by(id: row['business_id']) # needed to specify what column to use when finding it | |
| # Explicit mappings is important for maintainability and so it's clear what columns you expect. | |
| house.attributes = { | |
| address: row['address'], | |
| whatever: row['what_ever'], | |
| blah: row['blah_column'] | |
| } | |
| # this overwrites all data of any pre-existing records, too, which is probably a bad idea |
Forked from Captain Anonymous's Pen QyMWax.
A Pen by Ben Damman on CodePen.
Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.
Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.