Skip to content

Instantly share code, notes, and snippets.


James Doyle james2doyle

View GitHub Profile
james2doyle / Node Build.sublime-build
Last active Jul 28, 2020
A sublime build system for better Node.js output by highlighting with the right syntax
View Node Build.sublime-build
"target": "node_build",
"selector": "source.js",
"variants": [
"name": "JSON Output",
"json": true
james2doyle / .editorconfig
Created Jul 27, 2020
Basic editor config file that applies rules to all files the same way
View .editorconfig
# EditorConfig is awesome:
# Get the plugin:
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
james2doyle /
Last active Jul 24, 2020
A list of links to the documentation for the required templates in a Shopify theme
james2doyle / Popover.vue
Last active Jul 24, 2020
A popover component for Vue.js
View Popover.vue
Popover Component
<popover class="ml-3 inline-block align-text-top" v-cloak>
<template #icon>
<div class="w-5 icon-plus"></div>
<template #content>
james2doyle / hot-reload.js
Created Jul 23, 2020
Simple hot reload snippet
View hot-reload.js
if ( {
// reload the page when this global code is changed[
'./hot-reload.js', // same name as this file!
], window.location.reload);
james2doyle /
Created Jul 17, 2020
React native android automated build with a downloadable APK output
#!/usr/bin/env bash
cd android && keytool -genkey -v -keystore keystores/release-key.keystore -storepass MYAPP -alias MYAPP -keypass MYAPP -keyalg RSA -keysize 2048 -validity 10000 -dname \"CN=Android,O=Android,C=US\"
# Usage:
# python3 # everything
# python3 products # just products
# python3 collections # just collections
# python3 {PRODUCT_ID} # a specific product ID
import http.client
import json
import sys
#!/usr/bin/env bash
rm app/build/outputs/apk/release/app-release-unsigned-aligned.apk
rm app/build/outputs/apk/release/app-release.apk
$HOME/Library/Android/sdk/build-tools/29.0.0-rc3/zipalign -v -p 4 app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/app-release-unsigned-aligned.apk
$HOME/Library/Android/sdk/build-tools/29.0.0-rc3/apksigner sign --ks android.keystore --out app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/app-release-unsigned-aligned.apk
echo "signed: app/build/outputs/apk/release/app-release.apk"
james2doyle / docker-compose.yml
Created Jul 15, 2020
Use docker to showcase streaming with nginx rtmp
View docker-compose.yml
version: '3'
image: tiangolo/nginx-rtmp
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- "8080:80"
- "1935:1935"
james2doyle / cache-buster.js
Last active Jul 14, 2020
A cache-busting pattern based on a version file. Checks to see if an hour has passed before clearing or reseeding
View cache-buster.js
// <meta name="build-version" content="build-12345" />
// window.localStorage.setItem('cacheTime', '{{ date("%H") }}');
const CACHE_TIME = Number(window.localStorage.getItem('cacheTime') || '0');
const CURRENT_TIME = (new Date).getHours();
* The path to fetch the version text file from
* @type {String|null} VERSION_PATH
You can’t perform that action at this time.