Skip to content

Instantly share code, notes, and snippets.

View johnhamelink's full-sized avatar
🔨
Building

John Hamelink johnhamelink

🔨
Building
View GitHub Profile

$argon2id$v=19$m=64,t=512,p=2$DGsBCuBynJcMNZ2WRDzJhA$amIftiHhfifantvvOBRhLA

@johnhamelink
johnhamelink / git-pre-push-hook-install.sh
Last active January 29, 2021 08:13 — forked from ssaunier/git-pre-push-hook-install.sh
Made the echo command output colour on a Linux terminal, removed karma and added a crunchbang
cd /path/to/your/repo
curl https://gist.githubusercontent.com/johnhamelink/577b8613ae82d2b3037b/raw/ad71fb72a1b86ee9a90ac62eccc4a55367578625/pre-push.sh > .git/hooks/pre-push
chmod u+x .git/hooks/pre-push
@johnhamelink
johnhamelink / mullvad.sh
Created October 27, 2020 15:17
Mullvad VPN + Polybar = 😍
PID_FILE=~/.cache/mullvad-status-pid
SUCCESS_HOOK=1
SHUTDOWN_HOOK=1
finish() {
echo "Shutting down..."
rm $PID_FILE
rm $CACHE_FILE
#!/bin/bash
SMBUSERNAME="macuser"
SMBPASSWORD="X*aHm7qNUg1)"
SMBMOUNT="/Volumes/Test/"
SMBSHARE="OfficeDoc$"
SMBHOST="192.168.140.20"
rm -rf $SMBMOUNT
mkdir $SMBMOUNT
@johnhamelink
johnhamelink / config.org
Last active July 3, 2020 21:39
My org-roam config

Set Org Directory

(after! org
    (setq org-directory "~/org/"))

org-roam

Taken from Making Connections in your Notes (10:24) by Matt Williams:

(setq org-roam-directory "~/org/roam")
(setq org-roam-graph-viewer "qiv")
@johnhamelink
johnhamelink / papajohns.rb
Created March 28, 2015 21:23
Ruby CLI Client for Papa Johns' API
require 'rubygems'
require 'bundler/setup'
require 'faraday'
require 'pry'
require 'json'
@conn = Faraday.new(url: 'https://api.papajohns.co.uk') do |faraday|
faraday.adapter Faraday.default_adapter
end
# config file for ansible -- http://ansible.com/
# ==============================================
# nearly all parameters can be overridden in ansible-playbook
# or with command line flags. ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory or /etc/ansible/ansible.cfg, whichever it
# finds first
[defaults]
#!/bin/bash
album=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "album"|egrep -v "album"|egrep -v "array"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$`
artist=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "artist"|egrep -v "artist"|egrep -v "array"|cut -b 27-|cut -d '"' -f 1|egrep -v ^$`
title=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "title"|egrep -v "title"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$`
echo $artist " - " $album " - " $title;
namespace :db do
task ice_cube_test: :environment do
CSV.open("out.csv", "wb") do |csv|
Event.all.each do |event|
repeatable = event.repeatables.first
if repeatable.nil?
puts "Bad Event: #{event.id}. No Repeatable."
csv << [event.id, nil, nil, nil]
<Field name="color" label="T-Shirt Color" component={renderSelectField}>
<option></option>
<option value="Black">Black</option>
<option value="Charcoal">Charcoal</option>
<option value="Chocolate Brown">Chocolate Brown</option>
<option value="Grey Heather">Grey Heather</option>
<option value="Maroon">Maroon</option>
<option value="Military Green">Military Green</option>
<option value="Natural">Natural</option>
<option value="Navy">Navy</option>