Skip to content

Instantly share code, notes, and snippets.

@joestrong
joestrong / .ideavimrc
Last active December 21, 2022 16:54
Ideavimrc config
source ~/.vimrc
# IdeaVim config
sethandler <C-2> a:ide
sethandler <C-S-2> a:ide
sethandler <C-6> a:ide
sethandler <C-S-6> a:ide
sethandler <C-A> a:ide
sethandler <C-B> a:ide
sethandler <C-C> a:ide
@joestrong
joestrong / cleanup.sh
Created January 17, 2020 18:03
Clear caches from package managers
# Yay package manager
yay -Sc
# Yarn package manager
yarn cache clean
# Composer package manager
composer clear-cache
@joestrong
joestrong / main.js
Created December 4, 2018 20:46
Hue Lights from GPIO switch and LED
const gpio = require('rpi-gpio')
const gpiop = gpio.promise
const { HueApi, lightState } = require('node-hue-api')
const hue = new HueApi('##IP##', '##USERNAME##')
const lights = {
bedroom: 1,
bathroom: 2,
lounge: 3,
loungeLamp: 4
@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
@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 / 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 / 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 / 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 / Develop
Created February 24, 2016 19:15
Developing in ATOM
apm develop <package_name>
cd ~/.atom/dev/packages/<package_name>
atom -d
@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 () {