Skip to content

Instantly share code, notes, and snippets.

View jbryson3's full-sized avatar

John Bryson jbryson3

View GitHub Profile
@jbryson3
jbryson3 / mac-raspi.sh
Created June 21, 2016 03:31
Raspberry Pi OSX commands
# Backup sd card image (diskutil list - diskX, prepend with r), with progress (brew install pv), and gzip it
sudo dd if=/dev/rdisk1 bs=32m | pv -s 16G | gzip > backup.gz
@jbryson3
jbryson3 / docker.sh
Last active June 17, 2016 15:44
Docker Commands
# Build an image from Dockerfile in current dir
docker build -t image-name .
# List images
docker images
# List containers
docker ps
# Run a docker container from image, mount a live volume, and ssh into it
@jbryson3
jbryson3 / console-style.js
Created April 12, 2016 14:53
Styled console.log css
console.log("%cI'm red - %cI'm green", 'color:red;', 'color:green;')
@jbryson3
jbryson3 / example.user.js
Last active December 18, 2023 01:42
This is an example showing Gist capability and how to auto update
// ==UserScript==
// @name EXAMPLE SCRIPT
// @version 0.8
// @description This is an example showing Gist capability and how to auto update
// @author jbryson3
// @include https://www.google.com
// @grant none
// @updateURL https://gist.github.com/jbryson3/daabe54f25c4f71d6dee/raw/example.user.js
// @downloadURL https://gist.github.com/jbryson3/daabe54f25c4f71d6dee/raw/example.user.js
// ==/UserScript==
@jbryson3
jbryson3 / create-release-branch.sh
Last active December 21, 2015 16:57
GIT - Creating release branches without switching context
#!/bin/bash
# Create release branch of current directory repository off of develop without changing your working directory
# ./create-release-branch.sh new-release
git branch release/$1 origin/develop
git push -u origin release/$1
git branch -d release/$1
@jbryson3
jbryson3 / bind-attr-deprecation.hbs
Last active September 29, 2015 16:51
Ember.js bind-attr upgrade deprecation refactor
{{! bound property }}
<div {{bind-attr class="myProperty"}}>
<div class={{myProperty}}> {{! no need for wrapping quotes }}
{{! static class }}
<div {{bind-attr class=":static-class myProperty"}}>
<div class="static-class {{myProperty}}">
{{! inline if/else }}
<div {{bind-attr class="myPropertyIsTrue:awesome:lame"}}>
@jbryson3
jbryson3 / gist:25e6cafee46fa565df3d
Created March 24, 2015 14:50
OSX regex replace
grep -rl "require 'modules.*'" . | xargs sed -i "" "s/require 'modules(.*)'/require 'master-chief-cli$1'/g"
@jbryson3
jbryson3 / gist:eeb7bc3907bd0f2decdf
Created August 13, 2014 15:33
Using jszip with node to zip up local files
var JSZip = require('jszip');
var zip = new JSZip();
zip.file('image0.png', require('fs').readFileSync('files/image0.png'), {compression: "DEFLATE"});
var content = zip.generate({type:"nodebuffer"});
require('fs').writeFileSync('zippy.zip', content);