Skip to content

Instantly share code, notes, and snippets.

View joshwnj's full-sized avatar

Josh Johnston joshwnj

View GitHub Profile
const ct = require('countries-and-timezones')
const countries = ct.getAllCountries()
const flatten = (a) => a.reduce((acc, val) => acc.concat(val), [])
const unique = (a) => [...new Set(a)]
const combinations = Object.values(countries).map(country => {
const { id, name } = country

Let me start out by saying that I have zero intention of trying to convince you that my views are right and yours are wrong. Even if that were possible, I don't see how it could possibly be helpful or worthwhile for either of us. I've got no interest in that at all.

What I am interested in doing is answering your question, which relates to my comment that I have good reason for believing what I do. My belief can be summarised in one sentence: that Jesus is who he said he is. Following on from that, I find him the most worthy of admiration of any person I've ever heard about, and so naturally want to know him better, and learn to see the world the way he sees it.

As I said: I don't expect you to accept this as airtight proof that something in history definitely happened (what would

// @flow
import React, { PureComponent } from 'react'
import cmz from 'cmz'
import elem from '../utils/elem'
import type { Element } from 'react'
type Props = {
title?: string,
@joshwnj
joshwnj / twitterify.js
Created June 16, 2017 04:29
design refresh
document.querySelectorAll('*').forEach(function (a) { a.style['border-radius'] = '50%' })
@joshwnj
joshwnj / write.sh
Created April 21, 2017 06:41
very simple bash script to write a new blog post
#!/bin/bash
YYYY=$(date +%Y)
MM=$(date +%m)
DD=$(date +%d)
DIR=posts/$YYYY/$MM/$DD
FILE="$DIR/$1.md"
mkdir -p $DIR
echo "# $1" > $FILE
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.zkeleton = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
const upsertCss = require('./lib/upsert-css')
const createName = require('./lib/create-name')
function isName (val) {
if (!val) { return false }
return /^[a-zA-Z][a-zA-Z0
@joshwnj
joshwnj / init.lua
Created October 4, 2016 02:41
hammerspoon config for window resizing / moving in a grid
local hotkey = require "hs.hotkey"
local grid = require "hs.grid"
grid.MARGINX = 10
grid.MARGINY = 10
grid.GRIDHEIGHT = 3
grid.GRIDWIDTH = 7
local mash = {"cmd", "alt", "ctrl"}
local mashshift = {"cmd", "alt", "ctrl", "shift"}
@joshwnj
joshwnj / example.html
Created October 9, 2015 03:37
css modules + scoped styles?
<div>
<style scoped>
& {
background: #00F;
}
span {
color #FFF;
}
@joshwnj
joshwnj / a.js
Last active August 29, 2015 14:26
circular dependency
var b = require('./b')
console.log('B', b);
module.exports = {
doThingA: function () {
console.log('thing A');
b.doThingB();
}
}
var b = require('./b')
console.log('B', b);
module.exports = {
doThingA: function () {
console.log('thing A');
b.doThingB();
}
}