Skip to content

Instantly share code, notes, and snippets.

View shearn89's full-sized avatar

Alex Shearn shearn89

View GitHub Profile
@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 / 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 / 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

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

Part I: The Basics