Skip to content

Instantly share code, notes, and snippets.

View DaveHudson's full-sized avatar

Dave Hudson DaveHudson

View GitHub Profile
@DaveHudson
DaveHudson / Grunt-Installr
Created July 11, 2014 06:32
Grunt.js + Installr API
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
installr_settings: {
releaseNotes: grunt.file.read("./CHANGELOG.txt")
},
titanium: {
build_ios: { // build for ios first
@DaveHudson
DaveHudson / Ethereum.sh
Created December 13, 2017 10:44
Ethereum CLI
# Update Brew
brew upate
brew upgrade
# Install Ethereum
brew tap ethereum/ethereum
brew install ethereum
# Create an account on your node
geth account new
@DaveHudson
DaveHudson / Truffle.sh
Created December 13, 2017 10:50
Truffle
# Install Truffle globally
npm install -g truffle
# Download the box. This also takes care of installing the necessary dependencies
truffle unbox react
# Run the development console
truffle develop
# Compile and migrate the smart contracts
@DaveHudson
DaveHudson / .zshrc
Created February 10, 2018 20:59
Oh my Zsh settings
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/applification/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME=""
@DaveHudson
DaveHudson / .hyper.js
Last active December 6, 2018 18:06
Hyper Settings
// -- hyper-stylesheet-hash:3668d1255e9fc3fde9cd8c87cbdeb358 --
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Fira Code, Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.75)',
@DaveHudson
DaveHudson / pwa-splash-screen-images.html
Created February 14, 2018 16:33
PWA iOS Splash Screen Images
// 1. Media Queries based on data from https://css-tricks.com/snippets/css/media-queries-for-standard-devices
// 2. Images must be exact sizes e.g 640x1136
// 3. All images are portrait
<link rel="apple-touch-startup-image" href="images/splash/launch-640x1136.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-750x1294.png" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-1242x2148.png" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-1125x2436.png" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-
@DaveHudson
DaveHudson / apple-touch-startup-image.html
Last active January 19, 2021 08:50
PWA apple-touch-startup-image iOS
<link rel="apple-touch-startup-image" href="images/splash/launch-640x1136.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-750x1294.png" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-1242x2148.png" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-1125x2436.png" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/splash/launch-1536x2048.png" media="(min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
<lin
@DaveHudson
DaveHudson / index-script.html
Created February 26, 2018 19:11
Add Service Worker to HTML
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/service-worker.js')
.then(function (registration) {
console.log('Service Worker registration successful with scope: ', registration.scope)
})
.catch(function (err) {
console.log('Service Worker registration failed: ', err)
})
}
@DaveHudson
DaveHudson / package.json
Last active March 6, 2018 10:54
package.json
"scripts": {
"build": "preact build --no-service-worker --template src/template.html",
"serve": "preact build --no-service-worker --template src/template.html && preact serve"
}
@DaveHudson
DaveHudson / preact.config.js
Created February 26, 2018 19:12
preact.config.js
const WorkboxPlugin = require('workbox-webpack-plugin');
export default config => {
config.plugins.push(
new WorkboxPlugin.InjectManifest({
swSrc: './service-worker.js',
swDest: './service-worker.js',
include: [/\.html$/, /\.js$/, /\.svg$/, /\.css$/, /\.png$/, /\.ico$/]
})
);