Skip to content

Instantly share code, notes, and snippets.

View jonniespratley's full-sized avatar

Jonnie jonniespratley

View GitHub Profile
@jonniespratley
jonniespratley / RedisSessionStore.py
Created June 26, 2018 22:36 — forked from linnchord/RedisSessionStore.py
Flask session by Redis with pickle
# -*- coding:utf-8 -*-
"""
lib/RedisSessionStore.py
~~~~~~~~~~~~~~
Flask 0.7, session store in redis
ref by https://gist.github.com/994937
@jonniespratley
jonniespratley / webpack.config.js
Created May 5, 2018 15:34 — forked from timurcatakli/webpack.config.js
An Easy to Understand Webpack 4+ Configuration File with Comments
const publicPath = 'public';
// Node os module
// The os module provides a number of operating system-related utility methods.
// It can be accessed using:
const os = require('os');
// Using a single monolithic configuration file impacts comprehension and
// removes any potential for reusability.
// As the needs of your project grow, you have to figure out the means to manage
// webpack configuration more effectively.
@jonniespratley
jonniespratley / iterm2-solarized.md
Created April 30, 2018 22:08 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@jonniespratley
jonniespratley / repl-client.js
Created March 14, 2018 18:58 — forked from TooTallNate/repl-client.js
Full featured NodeJS repl server over a TCP socket (for node 0.6.x, uses some wacky server hacks)
var tty = require('tty')
var net = require('net')
var sock = net.createConnection(1337)
sock.on('connect', function () {
process.stdin.resume();
tty.setRawMode(true)
})
@jonniespratley
jonniespratley / CONCURRENCY.md
Created February 14, 2018 20:07 — forked from montanaflynn/CONCURRENCY.md
Examples of sequential, concurrent and parallel requests in node.js

Concurrency in JavaScript

Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.

@jonniespratley
jonniespratley / jenikns_ci_on_osx.md
Created December 2, 2017 16:27 — forked from ostinelli/jenkins_ci_on_osx.md
Setup Jenkins CI on OSX.

Jenkins CI on OSX

Instructions on how to setup a secured Jenkins CI on a Mac.

Download & Install dependencies

All of these operations are done with your admin user.

Developer tools

Install the command line developer tools.

@jonniespratley
jonniespratley / webpack.config.js
Created November 14, 2017 19:56 — forked from jaysoo/webpack.config.js
Minimum webpack config for development
// 1. npm init
// 2. npm install --save webpack webpack-dev-server babel-loader babel-preset-es2015
// 3. mkdir dist && touch index.html
// 4. Include `<script src="/bundle.js"></script>` inside index.html
// 5. mkdir src && touch src/index.js
// 6. Add some code to index.js (e.g. `console.log('Hello, World!'))
// 7. npm start
// 8. Browse to http://localhost:8080/dist/
const webpack = require('webpack')
@jonniespratley
jonniespratley / node-s3.js
Created October 17, 2017 23:41 — forked from sandfox/node-s3.js
Amazon S3 nodejs example - (not my own work)
/*
*
* A simple S3 library written because the other implementation doesn't meet needs and is outdated.
*
* What this library is good for:
*
* ** Can send files any size (although S3 is currently limited at 5 gigs)
* ** Streams files from disk to socket -- minimal memory footprint and very efficient
* ** Uses sockets to support 100 Continue (especially usefull for large files)
* - the body is only sent after amazon approves the signed header
@jonniespratley
jonniespratley / on-jsx.markdown
Created September 6, 2017 19:47 — forked from chantastic/on-jsx.markdown
JSX, a year in

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'

@jonniespratley
jonniespratley / index.js
Created April 10, 2016 20:55 — forked from max-mapper/index.js
requirebin sketch
var insertCSS = require('insert-css')
var domify = require('domify')
var css = ".button { display: inline-block; font-family: Arial; background-color: papayawhip; padding: 10px; border: 1px solid salmon; }"
var html = '<div class="button">BUTTON</div>'
// inserts new <style> tag into the <head>
insertCSS(css)
// append the html elements that domify returns to the <body>