Skip to content

Instantly share code, notes, and snippets.

@jschr
jschr / designer.html
Created October 1, 2014 14:48
designer
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-quiz-view.html">
<link rel="import" href="../topeka-elements/topeka-leaderboard.html">
<polymer-element name="my-element">

Recommended Books

A list of useful books to improve your skills

Recommendations from others are noted in (parentheses). The rest are my personal recommendations.

Programming

Building your core

  • The Pragmatic Programmer - Hunt & Thomas
@jschr
jschr / chromeLocalStorage.js
Last active August 3, 2016 19:09
chrome local storage module for redux-persist
export default {
getItem(key, cb) {
chrome.storage.local.get(null, (data) => {
if (chrome.runtime.lastError) return cb(chrome.runtime.lastError)
// data will be null if local storage is empty
data = data || {}
cb(null, data[key])
})
'use strict'
require('dotenv').load()
const Promise = require('bluebird')
const AppCompiler = require('@spin-io/sdk-app-compiler')
const tar = require('tar-stream')
const gzip = require('zlib').Gzip
const request = require('request')
import fontLatoRegular from './fonts/Lato-Regular.woff2'
import fontLatoBold from './fonts/Lato-Bold.woff2'
export const baseFontSize = '25px'
export const fontFamily = { fontFamily: 'Lato', src: `url(${ fontLatoRegular }) format('woff2')` }
export const fontFamilyBold = { fontFamily: 'Lato-Bold', src: `url(${ fontLatoBold }) format('woff2')` }
export const textColor = '#fff'
export const bgColor = '#fff'
@jschr
jschr / gist:84f5bbf93a33a2a3488cee339bfbce85
Created January 28, 2017 03:36
My high-level understanding of realtime architecture
There are a few layers involved in making a realtime app. Still learning the realtime architecture myself but internally, your infrastructure will need to be able to support reacting to updates instantly. That's pretty difficult to do when you have multiple servers and clients making updates while also asking to be notified of those changes in realtime.
RethinkDB handles that at the db level. Meaning your web servers can directly ask the database when an update has occurred. Most other databases don't have a way for servers to open a communication channel that allows them to be notified of database changes as they occur. In relational databases you could probably accomplish this with table triggers but I'm not too familiar with using them like that. RethinkDB makes it much easier, and has a cool query language. However in a lot of cases in realtime apps your clients will disconnect and reconnect and will require knowledge of the change log of updates since the last time it was connected. To do that you’d n
@jschr
jschr / index.ts
Created April 11, 2017 21:11
basic webpack config index.ts
export default function ({ username }) {
return `<html><body>hello ${username}</html></body>`
}
@jschr
jschr / getProps.ts
Created April 11, 2017 21:31
webpack step 2 getProps
export default async function getProps(username) {
const sumary = await getGithubSummary(username)
return summary
}
@jschr
jschr / Template.tsx
Created April 11, 2017 22:28
Basic template step 1
export default function Template({ body, ssr, js }) {
return (
<html>
<head>
<title>{ssr.appProps.username}</title>
</head>
<body>
<div id='react-root' dangerouslySetInnerHTML={{ __html: body }} />
<script dangerouslySetInnerHTML={{ __html: `window.ssr = ${JSON.stringify(ssr)}` }} />
{ js.map(src => <script src={src} />) }
@jschr
jschr / start_dev_server.sh
Created April 11, 2017 22:49
webpack tip #2
webpack-dev-server --env.FOO bar