Skip to content

Instantly share code, notes, and snippets.

Bobby puppybits

Block or report user

Report or block puppybits

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@puppybits
puppybits / .circleci___config.yml
Last active Nov 13, 2018
Parallelized Circle CI pipeline to build/deploy Re-Natal (w/ React Native & Om Next) project and upload DSYM to Sentry
View .circleci___config.yml
version: 2
references:
ios_config: &ios_config
macos:
xcode: "9.4.1"
working_directory: ~/my-project
environment:
FL_OUTPUT_DIR: output # for Fastlane
build_filter: &build_filter
@puppybits
puppybits / rerender.cljs
Created Sep 7, 2018 — forked from Peeja/rerender.cljs
What it appears to take to re-render the React tree when Figwheel reloads.
View rerender.cljs
;; Re-render when Figwheel reloads.
(gevents/listen js/document.body
"figwheel.js-reload"
(fn []
(let [root-component (om-next/app-root (compassus/get-reconciler a))]
(letfn [(js-vals [o]
(map #(aget o %) (js-keys o)))
;; Finds the children of a React internal instance of a component.
;; That could be a single _renderedComponent or several
;; _renderedChildren.
@puppybits
puppybits / ios.navigation.cljs
Created Feb 21, 2018
ClojureScript fix for ReactNative.NavigationIOS
View ios.navigation.cljs
(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]))
View 01-install.md

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 / dynamo-to-json.js
Last active Oct 22, 2017
Convert DynamoDB Export to standard JSON
View dynamo-to-json.js
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,
View npm-malicious-packages.sh
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 / Behavior Science Terms.md
Last active Nov 12, 2017
Behavior Science Terms
View Behavior Science Terms.md

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

@puppybits
puppybits / emac.md
Last active Feb 10, 2017
Emacs cheatsheet for common key commands
View emac.md

Diffing

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

Cursor

@puppybits
puppybits / index.html
Created Oct 5, 2016
Learn JS in 2016
View index.html
<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 / index.js
Created Sep 15, 2016
Rough minimal bootstrap for React w/ code splitting
View index.js
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');
You can’t perform that action at this time.