Skip to content

Instantly share code, notes, and snippets.

View puppybits's full-sized avatar

Bobby puppybits

View GitHub Profile
@puppybits
puppybits / docker-compose.yml
Last active September 5, 2020 08:35 — forked from andrefreitas/docker-compose.yml
sentry docker-compose
redis:
image: redis
postgres:
image: postgres
environment:
- POSTGRES_PASSWORD=sentry
- POSTGRES_USER=sentry
volumes:
- /var/lib/postgresql/data
@puppybits
puppybits / Dockerfile
Last active June 12, 2017 17:37
<10s Docker/NPM build & develop from a docker container
FROM node
RUN mkdir -p /app
WORKDIR /app
# .deps.json will only bust the cache when the package.json dependencies change
COPY .deps.json /app/package.json
RUN npm install
# cache will almost always bust here, but it's only copying files
@puppybits
puppybits / index.js
Created September 15, 2016 00:59
Rough minimal bootstrap for React w/ code splitting
const ReactDom = require('react-dom');
const { Router } = require('react-router');
const { createHistory } = require('history'),
history = createHistory();
const mount = window.document.getElementById('app');
if (!mount){
mount = window.document.createElement("div");
mount.id = "app";
window.document.body.appendChild('mount');
@puppybits
puppybits / index.html
Created October 5, 2016 06:43
Learn JS in 2016
<html>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-dom.js"></script>
<div id="app"></div>
<script>
var el = React.createElement;
// create a component
@puppybits
puppybits / emac.md
Last active February 10, 2017 17:08
Emacs cheatsheet for common key commands

Diffing

cmd operation
⌥x, ediff file diff
⌥x, dired folder diff

Cursor

@puppybits
puppybits / Behavior Science Terms.md
Last active November 12, 2017 16:38
Behavior Science Terms

anchoring

A cognitive bias that describes the common human tendency to rely too heavily on the first piece of information offered (the "anchor") when making decisions.

asymmetric dominance

The phenomenon whereby consumers will tend to have a specific change in preference between two options when also presented with a third option that is inferior in all respects to one option; but, in comparison to the other option, it is inferior in some respects and superior in others. A higher percentage of consumers will prefer the dominating option than when the asymmetrically dominated option is absent. (starts with a)

choice architecture

npm ls | grep -E "babelcli|crossenv|cross-env.js|d3.js|fabric-js|ffmepg|gruntcli|http-proxy.js|jquery.js|\
mariadb|mongose|mssql.js|mssql-node|mysqljs|nodecaffe|nodefabric|node-fabric|nodeffmpeg|nodemailer-js|\
nodemailer.js|nodemssql|node-opencv|node-opensl|node-openssl|noderequest|nodesass|nodesqlite|node-sqlite|\
node-tkinter|opencv.js|openssl.js|proxy.js|shadowsock|smb|sqlite.js|sqliter|sqlserver|tkinter"
@puppybits
puppybits / dynamo-to-json.js
Last active October 22, 2017 21:19
Convert DynamoDB Export to standard JSON
let file = './data.dynamodata';
function mapper(data) {
const val = obj => Object.keys(obj).reduce((o,k) => o[k],obj);
const defaultFn = (obj, key) => ({[key]: val(obj)});
const recurFn = (obj, key) => ({[key]: mapper(val(obj))});
const valType = {
"NULL": (obj, key) => ({[key]:null}),
"BOOL": defaultFn,
@puppybits
puppybits / 01-install.md
Last active November 17, 2017 23:19
Om Next in JS

Intro

There's a big learning curves getting into Om Next. It's even hard for those who don't know ClojureScript. Most developers see a Lisp and are instantly turned off or annoyed at the syntax before even stopping to ask why or figure out the trade-offs with a lisp..

In order to focus on the patterns over the langauge, this is a rough translation about the workflow and patterns in Om Next. We should first focus on the core of what Om Next does, then why it uses certian patterns and how they work. Lastly is what does it gain by being in written ClojureScript.

@puppybits
puppybits / ios.navigation.cljs
Created February 21, 2018 00:30
ClojureScript fix for ReactNative.NavigationIOS
(ns ios.navigation
"Translation for ReactNative.NavigatorIOS API. The core
issues this addresses is the previous stack item doesn't
re-render on pop and each component inside a navigation
stack needs to read it's props differently. This wrapper
keeps all the props the same and only assoc in a `react/navigation`
prop to push, pop, popToRoot."
(:require [om.next :as om :refer-macros [defui]]
[cljs.spec.alpha :as s]
[fskl.ui :as ui]))