Skip to content

Instantly share code, notes, and snippets.

@joeinnes
joeinnes / Config.sh
Last active February 26, 2024 04:28
Config
#!/bin/sh
# Get my apps
# Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Cask
brew tap caskroom/cask
# Apps
@joeinnes
joeinnes / Apps I Want
Last active March 13, 2017 20:56
Apps
#!/bin/sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # Homebrew
brew tap caskroom/cask # Cask
brew cask install cakebrew # Cakebrew
brew cask install google-chrome # Chrome
brew cask install franz # Franz
brew cask install spotify # Spotify
brew cask install vlc # VLC
brew cask install calibre # Calibre
brew cask install steam # Steam
@joeinnes
joeinnes / Advent of Code 2016 Day 4.js
Created December 4, 2016 10:31
Advent of Code 2016 Day 4 created by joeinnes - https://repl.it/Ef5v/4
const input = `bkwzkqsxq-tovvilokx-nozvyiwoxd-172[fstek]
wifilzof-wbiwifuny-yhachyylcha-526[qrazx]
jvyyvzpcl-jhukf-shivyhavyf-487[zhtsi]
kwvacumz-ozilm-kivlg-kwvbiqvumvb-694[gknyw]
mvhkvbdib-kmjezxodgz-mvwwdo-omvdidib-837[dmvbi]
nzydfxpc-rclop-qwzhpc-lnbftdtetzy-171[cptzd]
vhehkyne-unggr-inkvatlbgz-813[gnehk]
tcorcikpi-hnqygt-octmgvkpi-570[nzewo]
xmtjbzidx-wvnfzo-jkzmvodjin-447[uyzlp]
willimcpy-mwupyhayl-bohn-mufym-734[stjoc]
@joeinnes
joeinnes / Advent Of Code 2016 Day 1.js
Created December 4, 2016 09:21
Advent Of Code 2016 Day 1 created by joeinnes - https://repl.it/EfFK/24
const input = 'R3, L2, L2, R4, L1, R2, R3, R4, L2, R4, L2, L5, L1, R5, R2, R2, L1, R4, R1, L5, L3, R4, R3, R1, L1, L5, L4, L2, R5, L3, L4, R3, R1, L3, R1, L3, R3, L4, R2, R5, L190, R2, L3, R47, R4, L3, R78, L1, R3, R190, R4, L3, R4, R2, R5, R3, R4, R3, L1, L4, R3, L4, R1, L4, L5, R3, L3, L4, R1, R2, L4, L3, R3, R3, L2, L5, R1, L4, L1, R5, L5, R1, R5, L4, R2, L2, R1, L5, L4, R4, R4, R3, R2, R3, L1, R4, R5, L2, L5, L4, L1, R4, L4, R4, L4, R1, R5, L1, R1, L5, R5, R1, R1, L3, L1, R4, L1, L4, L4, L3, R1, R4, R1, R1, R2, L5, L2, R4, L1, R3, L5, L2, R5, L4, R5, L5, R3, R4, L3, L3, L2, R2, L5, L5, R3, R4, R3, R4, R3, R1'
const inputArray = input.split(', ')
function mover() {
this.xPos = 0
this.yPos = 0
this.heading = 0
this.visited = []
this.visitedTwice = []
this.turn = (direction) => {
@joeinnes
joeinnes / Advent of Code 2016 Day 3.js
Created December 4, 2016 09:20
Advent of Code 2016 Day 3 created by joeinnes - https://repl.it/EfFW/17
const input = ` 810 679 10
783 255 616
545 626 626
84 910 149
607 425 901
556 616 883
938 900 621
638 749 188
981 415 634
680 557 571
@joeinnes
joeinnes / Advent Of Code 2016 Day 2.js
Created December 4, 2016 08:19
Advent Of Code 2016 Day 2 created by joeinnes - https://repl.it/EfFJ/3
const input = `LLLUDRDLLULDUDLLRLUDURULDURRRRLLURLDLDDDULLDDUDLRDLRDUURRDUUDLLRUUDDLULURDLRDUUDUDRURULLLLDRULDDLRDDRDLRDDLURLDDUDLLUUDLRDDDDLULUUURRDLUUDDLULLURRRDULLUDUDRDRDDRLDLLRLRDDDRDLULLUULDLLLRRDDUURUURDLLDRRDDLRULDLLDRLLUDRRDLUUULDLURLLDDURRUULLLLLRLUDLDDLLLURRRDUDULRULULDDLLDLRDDDUULRLRDUURLURRUDDURRUUDUDLDDLDULDDDDDULRULRDLRLDLRDLDDLUDRDUUDLDUDUDLLLRLUUDRUDDDRDRURRLLLDLUULDUULRDLULLUURLDRRRLDRLUDRRURLDULULDRUDDULLLDRDLLULUDDDDRDRULDULRRRRDDRULDLRDU
DLDDRRDLLDUURRLULLLLRDRLUDURLDRRDURRRRUUDDUDRRDDDRRLDDLDDLURDLDRLUDULDUDUUDDDLLULRRLLUDULLLUULDDRDDUDUUDULURULULLDRLRUURDRDDLRRUDRUULLLLURRUDRDULDDRURRURLLLLLRLLLRLLUDUDLRDLULDUDLULLLUUDLLDDDUDUDLLRRDLRDLLLRRLRUDRDUDRURLUUURULLDDDDLLURDULURRLLLRLRRULLRRRLUUULLLLRLRDUURRDUURLLLDRDURRRULDDUDRRDLRLDLLRUDDLLUDRLLUUDRLLLLLLUDLURLLRUDRUUUULDLUDULLDDDDRLURUURDDDURRRLRLUDUUDURDDDDRRLRDLURDDLLULDRDDURLLURULUUUUURDUUULDRRLLURRRRRLDDUULLRULLDLDLDLRRRDRLDRUUD
RLDRRRURULDLUDLDUDLLDUUURRDUDDURULLRRDDULUUDRRRULRUURRRLUUULRDRUDRRLLRLURDLDRDRDLLUDRUULRUDRUDDRURLRLURRDDRRU
@joeinnes
joeinnes / FileDownloader
Last active August 31, 2016 16:54
Collection of macros to download a file using Internet Explorer, collate a bunch of emails from yesterday, assess whether they're 'new' or 'updated', and then send the whole thing to a particular email address.This macro can be deployed in Outlook 2013.Why the hell do I need to do that? Well, because without authenticating into our proxy at work…
Public Sub DownloadFile()
' Requires 'Sleep' function
Dim IE As Object
Dim timeout As Date
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = False
'Navigate to a page to trigger Zscaler authentication
@joeinnes
joeinnes / ☺ Licence
Last active December 24, 2017 16:26
Visual Idiot's ☺ Licence
By attaching this document to the given files (the “work”), you, the licensee, are hereby granted free usage in both personal and commerical environments, without any obligation of attribution or payment (monetary or otherwise). The licensee is free to use, copy, modify, publish, distribute, sublicence, and/or merchandise the work, subject to the licensee inflecting a positive message unto someone. This includes (but is not limited to): smiling, being nice, saying “thank you”, assisting other persons, or any similar actions percolating the given concept.
The above copyright notice serves as a permissions notice also, and may optionally be included in copies or portions of the work.
The work is provided “as is”, without warranty or support, express or implied. The author(s) are not liable for any damages, misuse, or other claim, whether from or as a consequence of usage of the given work.
Congratulations, you’ve got something with the best licence ever.
Basically, you’re free to do what you want with it; as l
@joeinnes
joeinnes / deploy-wp.sh
Last active March 25, 2018 09:21
Wordpress deploy into ServerPilot app
#!/bin/bash
# Script to deploy Wordpress into a ServerPilot app.
# Call programmatically via ssh - ssh <serverpilot-username>@<serverpilot-host> "curl <script-url> | sh -s <app-name> <db-name> <db-user> <db-user-pw>"
# This will prompt for password unless the user is able to log in using keys
cd /srv/users/serverpilot/apps/$1/public
wget https://wordpress.org/latest.tar.gz
@joeinnes
joeinnes / ghost-setup.sh
Last active May 11, 2016 17:18
Set up Ghost on a fresh server.
#!/bin/bash
# Written by Andy Boutte and David Balderston of howtoinstallghost.com and allaboutghost.com
# Modified to include Nginx by Joe Innes
######Check to make sure script is being run as root######
if [[ `whoami` != root ]]; then
echo "This script must be run as root"
exit 1
fi