Skip to content

Instantly share code, notes, and snippets.

@joestrong
joestrong / docker-nginx-php7fpm
Created September 20, 2015 14:29
Simple Nginx & PHP-FPM setup
docker run -tid -v /home/user/webdir:/usr/share/nginx/html --name php7fpm php:7-fpm
docker run -tidp 127.0.0.1:80:80 -v /home/user/webdir:/usr/share/nginx/html -v /home/user/webdir/nginx-host.conf:/etc/nginx/conf.d/default.conf --link php7fpm --name webapp nginx
@joestrong
joestrong / .aliases
Last active October 20, 2015 23:47
Bash/Zsh aliases/config
alias dc="docker-compose"
alias spec="./vendor/bin/phpspec"
alias behat="./vendor/bin/behat"
alias jasmine="./node_modules/jasmine/bin/jasmine.js"
alias ll="ls -lah"
@joestrong
joestrong / .vimrc
Last active February 13, 2016 19:39
.vimrc configuration
set nocompatible
set number
:inoremap jj <ESC>
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab
:set backspace=indent,eol,start
@joestrong
joestrong / script.js
Created January 28, 2016 19:07
Node get GPS data from GPSD
var gpsd = require('node-gpsd');
var gpsData = null;
var gpsListener = new gpsd.Listener({
port: 2947,
hostname: 'localhost'
});
function startGPS () {
@joestrong
joestrong / Develop
Created February 24, 2016 19:15
Developing in ATOM
apm develop <package_name>
cd ~/.atom/dev/packages/<package_name>
atom -d
@joestrong
joestrong / keymap.cson
Last active April 28, 2016 17:36
Atom Settings
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
@joestrong
joestrong / Instructions.md
Last active April 6, 2023 13:30
Boot to application on Raspberry Pi

How to boot straight to application, with auto-login, and fluxbox as a window manager

  1. Write the raspbian-jessie-lite image to an SD card
  2. Run apt-get install xorg-server xinit fluxbox
  3. Edit /etc/systemd/system/getty.target.wants/[email protected] and add your username to ExecStart like ExecStart=-/sbin/agetty -a <user name> %I $TERM
  4. Add to bottom of .profile: [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
  5. Add ~/.xinitrc with:
exec /usr/bin/startfluxbox
@joestrong
joestrong / Guide.md
Last active September 16, 2020 21:29
Linux Emoji Support

Install fonts:

  • Bitstream Vera
  • Noto Color Emoji

We set these fonts as the fallbacks, bitstream has the normal characters, Noto has the emoji

We don't want DejaVu to be used as a fallback, as this has overriding emoji

@joestrong
joestrong / setup.sh
Last active February 26, 2020 19:35
Raspberry Pi setup
# Run this script from RPi
# curl -sS https://gist.github.com/joestrong/a65464a7bb2a44d6950eb613cce8d23c/raw/14dbdf6960b92c2034b96012f802c5f12bf054e8/setup.sh | bash -
# Config
cat <<EOF > ~/.vimrc
set nocompatible
set number
:inoremap jj <ESC>
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab
:set backspace=indent,eol,start
@joestrong
joestrong / git-setup.sh
Last active October 19, 2019 11:03
Git Setup
git config --global alias.f "fetch --all -p"
git config --global alias.b "branch"
git config --global alias.ba "branch -a"
git config --global alias.m "merge --no-ff"
git config --global pager.branch false