⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
;; inspired by suggestion in THE doc: http://java.ociweb.com/mark/clojure/article.html | |
(ns bootcamp.multi-method) | |
(defn measure-it [size] | |
(cond | |
(< size 3) :small | |
(< size 6) :medium | |
(< size 12) :large | |
:else :hard-to-measure )) |
<!-- copy this to YOUR_THEME.tmTheme--> | |
<dict> | |
<key>name</key> | |
<string>diff: deleted</string> | |
<key>scope</key> | |
<string>markup.deleted</string> | |
<key>settings</key> | |
<dict> | |
<key>background</key> | |
<string>#EAE3CA</string> |
set softtabstop=2 | |
set shiftwidth=2 | |
set tabstop=2 | |
set expandtab "expandtab (whitespace) | |
set number "line numbers | |
set ai "autoindent | |
set si "smartindent | |
set tw=79 "wrap on 79 | |
set sta "smarttab | |
set history=100 "remember more than 20 cmd-history |
Since many deployments may start out with 3 nodes and so little is known about how to grow a cluster from 3 memebrs to 5 members without losing the existing Quorum, here is an example of how this might be achieved.
In this example, all 5 nodes will be running on the same Vagrant host for the purpose of illustration, running on distinct configurations (ports and data directories) without the actual load of clients.
YMMV. Caveat usufructuarius.
from bs4 import BeautifulSoup | |
from urllib2 import urlopen | |
from datetime import datetime, timedelta | |
from time import sleep | |
import sys | |
import csv | |
# CONSTANTS | |
ESPN_URL = "http://scores.espn.go.com" |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
Vagrant 1.6 has a really nice feature which allows you to run a docker environment from any machine that can run Vagrant (even a Mac)
Behind the scenes, Vagrant creates a host VM which runs the docker containers.
The "gotcha" is: Vagrant won't automatically forward ports all the way back from the container->vagrant host VM->your mac. You have to do that step manually, by configuring your own host VM for Vagrant to use for hosting docker containers with. That host VM is told what ports to open.
Here's how I set up a local Wordpress development testing container.
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent