Skip to content

Instantly share code, notes, and snippets.

View shearn89's full-sized avatar

Alex Shearn shearn89

View GitHub Profile

I'll be buying a mac in september. Here's a preliminary list!

Part I: The Basics

@shearn89
shearn89 / gist:1379195
Created November 19, 2011 18:34
Why you should use filter()

Why you should use filter()

So, I'm currently doing the last bit of Text Technologies coursework, and am profiling my code to make it run quicker. The slowest bit was the cleaning of self-linked vertices from the graph that we have to analyze.

I started by doing this in a (fairly horrible) for loop:

def cleanSelfMails(graph):
        print "> Removing a->a type links."
 count = 1
@shearn89
shearn89 / s0700157_rails_config.md
Created November 24, 2011 15:46
Configuration instructions for deploying my rails project

Configuring a Rails Server

Assuming Kerberos is set up, and Apache (or nginx) and MySQL (or other db) are installed, this guide should work fine. NOTE: RVM needs to be installed via sudo, not directly as root.

  1. Prepare installation of RVM:
    1. install build tools such as build-essential
    2. install git
  2. Follow the instructions found here: https://rvm.beginrescueend.com/rvm/install for multi-user install. Although this installs it for all users locally, we need to add the lines specified in step 2 to the top of /etc/bash.bashrc, ensuring that rvm and all $PATHs work over ssh.
  3. rvmsudo rvm install 1.9.2 followed by rvmsudo rvm use --default 1.9.2. These should make sure that all users are now using ruby 1.9.2 - easily checkable by logging in as a non-root user and doing which ruby (which should include rvm in the path somewhere), or ruby -v.
  4. sudo gem install rails. This should install rails 3.
@shearn89
shearn89 / Keymap.c
Created January 30, 2022 10:44
Current QMK keymap
#include <stdint.h>
#include "annepro2.h"
#include "config.h"
enum anne_pro_layers {
_QWERTY,
_WORKMAN,
_FN1_LAYER,
_FN2_LAYER,
@shearn89
shearn89 / gist:efb4864f764497f9346a4732af8e8504
Created July 18, 2024 16:25
Make VT/console Solarized on Raspberry Pi 5
# This sets the colours of the VT/console/TTY persistently.
# Append this to the end of your /boot/firmware/cmdline.txt
vt.default_red=0,220,133,181,38,211,42,238,0,203,88,101,131,108,147,253 vt.default_grn=43,50,153,137,139,54,161,232,43,75,110,123,148,113,161,246 vt.default_blu=54,47,0,0,210,130,152,213,54,22,117,131,150,196,161,227