Skip to content

Instantly share code, notes, and snippets.

View homelinen's full-sized avatar

Calum Gilchrist homelinen

View GitHub Profile
@homelinen
homelinen / ability.rb
Created March 25, 2013 22:30
Wattball permissions
class Ability
include CanCan::Ability
def initialize(user)
alias_action :read, :create, :edit, :to => :modify
alias_action :read, :edit, :destroy, :to => :self_maintain
user ||= User.new
if user.team
@homelinen
homelinen / difficulties.haml
Created March 18, 2013 22:55
Page for my general maintenance pages: http://chunk.homelinen.org/404
!!! 5
%html
%head
%title On It's Way
%link(rel="stylesheet" type = "text/css" href = "template.css")
%link(rel = "stylesheet"
type = "text/css"
href = "'http://fonts.googleapis.com/css?family=Roboto:700'")
@homelinen
homelinen / deploy.rb
Created March 18, 2013 00:05
My Deploy file for my group project, in capistrano
require "bundler/capistrano"
require "capistrano-rbenv"
# Pre-compile assets
load 'deploy/assets'
set :application, "wattball"
set :repository, "[email protected]/USER/PROJECT"
set :branch, "master"
@homelinen
homelinen / wireless-status.sh
Created February 27, 2013 16:12
Simple bash script to get wireless information from wicd.
#!/bin/bash
#
# Possible Implementation for testing the wireless signal
# Outputs:
# {essid} {quality}
wicd-cli --wireless -d | grep -P -i "essid|quality" | cut -d " " -f 2 | awk '!/0$/{printf "%s ",$0}/0$/'
@homelinen
homelinen / malloc.c
Created February 24, 2013 15:07
Very Simple Malloc
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "malloc.h"
#include "chunk.h"
/* Globals */
Chunk* chunks;
@homelinen
homelinen / readitlater.rb
Last active December 12, 2015 07:08 — forked from StarWhite/readitlater.rb
Earthquake plugin to post urls to Pocket.
# earthquake.gem plugin
# post url to Pocket
require 'open-uri'
Earthquake.init do
_ = config[:ril] ||= {}
_[:apikey] ||= 'your-consumer-key'
# Sign Up for the Pocket API
# https://getpocket.com/developer/apps/new
@homelinen
homelinen / z-notation-parser.c
Last active December 11, 2015 12:09
First attempt at a Z-Notation parser. Decided to go with Java instead.
#include <stdlib.h>
#include <stdio.h>
#define LBR '{'
#define RBR '}'
#define INTEGER 1
#define SET 5
#define PAIR 6
#define TREE 7
@homelinen
homelinen / status.sh
Created January 20, 2013 16:33
My dzen bar for i3.
#!/bin/bash
# ------------------------------------------------------
# file: $HOME/.scripts/dzenstat.sh
# author: Ramon Solis - http://cyb3rpunk.wordpress.com
# modified: June 2011
# vim:fenc=utf-8:nu:ai:si:et:ts=4:sw=4:ft=sh:
# ------------------------------------------------------
# -------------------------
@homelinen
homelinen / testDiskSpeed.sh
Created January 3, 2013 13:17
Short script to test read and write on a disk
#!/bin/bash
# Some simple read and write tests using dd
# Write
echo "Write"
dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc
# Read Without Cache
echo "Read w/o Cache"
sudo echo 3 > sudo /proc/sys/vm/drop_caches
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
#Back ups
*.tmp
*.bak