// Claude Code is a Beta product per Anthropic's Commercial Terms of Service. | |
// By using Claude Code, you agree that all code acceptance or rejection decisions you make, | |
// and the associated conversations in context, constitute Feedback under Anthropic's Commercial Terms, | |
// and may be used to improve Anthropic's products, including training models. | |
// You are responsible for reviewing any code suggestions before use. | |
// (c) Anthropic PBC. All rights reserved. Use is subject to Anthropic's Commercial Terms of Service (https://www.anthropic.com/legal/commercial-terms). | |
// Version: 0.2.9 |
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.
I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a
beforeEach
. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern
that gives great defaults for each test example but allows every example to override props
when needed:
(ns savage.core | |
(:require-macros [reagent.ratom :refer [reaction]]) | |
(:require [reagent.core :as reagent :refer [cursor atom track track!]] | |
[reagent.ratom :refer [make-reaction]] | |
[clojure.set :as set] | |
[clojure.string :as string])) | |
(enable-console-print!) | |
(defn sqrt [x] (.sqrt js/Math x)) |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
node-gyp needs more ram or swap space to install. Use these commands to create swap space as root. (if using sudo, then put the following in a file and then run it using sudo).
Assumes you have Ubuntu. Should work for most Debian-based OSes.
These are quick copy-paste commands to create 2gb swap space. Look at the end for info.
# feel free to change below values
// ------------ | |
// counterStore.js | |
// ------------ | |
import { | |
INCREMENT_COUNTER, | |
DECREMENT_COUNTER | |
} from '../constants/ActionTypes'; | |
const initialState = { counter: 0 }; |
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |
/* bling.js */ | |
window.$ = document.querySelector.bind(document); | |
window.$$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
NodeList.prototype.__proto__ = Array.prototype; | |
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |