Skip to content

Instantly share code, notes, and snippets.

View sethkrasnianski's full-sized avatar
:shipit:
Building software.

Seth Krasnianski sethkrasnianski

:shipit:
Building software.
View GitHub Profile
@sethkrasnianski
sethkrasnianski / emoji-count.js
Last active January 30, 2017 04:01
User emoji contribution on Slack
const userCount = Array
.from(document.querySelectorAll('.author_cell a'))
.map((node) => node.innerText)
.sort()
.reduce((prev, curr) => (prev[curr] = ++prev[curr] || 1, prev), {});
const sortedCount = Object
.keys(userCount)
.sort((a,b) => userCount[b] - userCount[a])
.map(u => [u, userCount[u]])
@sethkrasnianski
sethkrasnianski / circle-ci-browser-testing.md
Last active November 29, 2016 21:57
CircleCI Browser Testing (Mac)
  1. Enable SSH
  2. Enable port forwarding with SSH
    ssh -p PORT ubuntu@IP_ADDRESS -L 5902:localhost:5901
  1. Start the VNC server
    vnc4server -geometry 1280x1024 -depth 24
  1. It will ask for a password which is password
@sethkrasnianski
sethkrasnianski / magi(c)t.md
Last active January 30, 2017 04:02
Magi(c)t

Because it’s practically magic.

Switching branches

SPC + g + s      - git status

    b                  - branch menu
        b              - select a branch

Creating branches

@sethkrasnianski
sethkrasnianski / webpack-static-files.js
Last active November 29, 2016 22:03
Webpack static file goodness
const HtmlWebpackPlugin = require('html-webpack-plugin');
function buildPages(people) {
return [
new HtmlWebpackPlugin({
template: './templates/index.pug',
filename: 'index.html'
}),
new HtmlWebpackPlugin({
template: './templates/people.pug',

Types

A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.

Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer. In that case, the programmer isn't allowed to say x = true; that would be an invalid program. The compiler will refuse to compile it, so we can't even run it.

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I lead the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can'

@sethkrasnianski
sethkrasnianski / socket.clj
Created April 21, 2016 04:36 — forked from ibdknox/socket.clj
compojure with websockets
(ns wl.core
(:use compojure.core, aleph.core, aleph.http, hiccup.core, hiccup.page-helpers)
(:require [compojure.route :as route])
(:gen-class))
(def broadcast-channel (channel))
(defn chat-handler [ch handshake]
(receive ch
(fn [name]
var SLACK_ROOM_URL = process.env.SLACK_ROOM_URL;
var page = require('webpage').create();
var url = 'https://www.mojotech.com/contact-form';
phantom.notifySlack = function(id, text, code) {
var settings = {
operation: 'POST',
encoding: 'utf8',
headers: {