Skip to content

Instantly share code, notes, and snippets.

View alexblackie's full-sized avatar

Alex Blackie alexblackie

View GitHub Profile
@alexblackie
alexblackie / keypush.sh
Last active October 4, 2015 11:08
Add SSH Key to server
cat ~/.ssh/id_rsa.pub | ssh user@host 'cat >> ~/.ssh/authorized_keys'
@alexblackie
alexblackie / linecount.sh
Created June 1, 2012 02:49
Count the lines of code in a PHP project (Unix-only) (Rough count)
wc -l `find . -iname "*.php"`
@alexblackie
alexblackie / index.html.slim
Created August 29, 2012 23:57
Colourful block menu - Preview: http://cl.ly/J6aG
nav.main-menu
a.nav-articles href="/" Articles
a.nav-portfolio href="/portfolio" Portfolio
a.nav-projects href="/projects" Projects
a.nav-speaking href="/speaking" Speaking
a.nav-about href="/about" About
a.nav-contact href="/contact" Contact
$primary-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif
$button-height: 40px
$button-font-size: 16px
$button-background: #30AFEC
$button-gradient: linear-gradient(top, lighten($button-background, 5%) 0, darken($button-background, 7%) 100%)
$button-border: darken($button-background, 2%) darken($button-background, 5%) darken($button-background, 11%)
$button-disabled-color: #aaa
$button-disabled-border: rgba(black, 0.2) rgba(black, 0.15) rgba(black, 0.1)
@alexblackie
alexblackie / post-receive.sh
Created January 31, 2013 09:39
Deploy a Middleman site by building it server-side on a Git post-receive (making deployment as easy as "git push").
#!/bin/sh
# Simply point your virtualhost to the GIT_WORK_TREE below, with "/build" appended. (ex: /path/to/webroot/example.com/build)
# This is how I manage all of my sites. I highly recommend this setup.
GIT_WORK_TREE=/path/to/webroot/example.com # Set this to your webroot path (sans build)
export GIT_WORK_TREE
git checkout -f
# Enter Directory
@alexblackie
alexblackie / rubydeps.sh
Created October 3, 2013 03:13
Ruby dependencies (for compilation) on Fedora
sudo yum install git-core curl make bzip2 gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel libxslt-devel sqlite sqlite-devel openssl openssl-devel
@alexblackie
alexblackie / UTC.reg
Created October 10, 2013 02:45
Force Windows to use UTC hardware clock.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001
@alexblackie
alexblackie / user.sh
Created November 17, 2013 20:59
Add an SFTP-only user. Note: needs sshd_config to define the www-users group as sftp-only.
#!/bin/bash
#-----------------------------------------------------------------------
# Add User Script
#-----------------------------------------------------------------------
# Create directory
mkdir -p /var/www/$1
# Add account
useradd -s/bin/sh -b/var/www -gwww-users $1
@alexblackie
alexblackie / private.xml
Created May 12, 2014 22:18
Play/Pause on non-apple keyboards
<?xml version="1.0"?>
<root>
<item>
<name>Play/Pause on Print</name>
<identifier>private.play_pause_on_printscreen</identifier>
<autogen>__KeyToKey__ KeyCode::F13, ConsumerKeyCode::MUSIC_PLAY</autogen>
</item>
<item>
<name>Enqueue play/pause Everywhere!</name>
@alexblackie
alexblackie / alexblackie.man
Last active December 3, 2015 18:16
% man alexblackie
ALEX(8) World Wide Web Person Manual ALEX(8)
NAME
Alex Blackie -- web developer at MetaLab
USAGE
twitter(1) - @alexblackie
email(1) - alex@alexblackie.com
gpg(1) - http://pgp.mit.edu/pks/lookup?op=get&search=0xF6AA8E960D9F7F9F
ssh(1) - http://key.alexblackie.com/