Skip to content

Instantly share code, notes, and snippets.

View addamh's full-sized avatar

Addam Hardy addamh

View GitHub Profile
PING kali.normes (192.168.1.23): 56 data bytes
ping: sendto: No buffer space available
ping: sendto: No buffer space available
Request timeout for icmp_seq 0
ping: sendto: No buffer space available
Request timeout for icmp_seq 1
ping: sendto: No buffer space available
Request timeout for icmp_seq 2
ping: sendto: No buffer space available
Request timeout for icmp_seq 3
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript
powered JS and SASS powered CSS with YUI compression all via the magic of rack.
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist.
question_id | Answer1 | Answer2 | Answer3 | Answer4
1 5.0 2.5 1.5 3.5
@addamh
addamh / gist:943084
Created April 26, 2011 20:41
seed.rb
AlgebraPhrase.all.each do |d|
question_data = {
:question_type => d.question_type,
:question_number => d.question_number.to_i,
:question_text => d.question_text,
:strand_num => d.strand_number
}
question = Question.create!(question_data)
for i in (1..4)
ddam@Hera:~/dev/normes/prova (develop): $> cuke -p wip
Using the wip profile...
Feature: Manage custom exams
As a teacher
I should be able to manage custom exams by creating, viewing, deleting and assigning them to students
@javascript @wip
Scenario: View custom exam history # features/teacher_can_manage_custom_exams.feature:17
Given the following Teacher: # features/step_definitions/fabrication_steps.rb:69
| username | teacher |
@addamh
addamh / bootstrap.sh
Created May 28, 2011 15:50
NORMES MacOSX Development System Bootstrap Script
#!/usr/bin/env bash
echo "Fixing Samba..."
echo "[default]" > ~/Library/Preferences/nsmb.conf
echo "streams=no" >> ~/Library/Preferences/nsmb.conf
echo "Removing System Gems..."
rm -r /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
gem update --system
gem clean
@addamh
addamh / ubuntu-setup.sh
Created May 29, 2011 04:15
NORMES Ubuntu Development System Bootstrap Script
#!/bin/bash
echo "Updating Packages..."
apt-get -qq -y update
echo "Installing Vim..."
apt-get -qq -y install vim-gnome
echo "Installing Utilities..."
apt-get -qq -y install curl bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2-dev
import java.util.Scanner;
import java.io.*;
public class Student
{
private int id;
private String name;
Student(int studentId, String studentName){
id = studentId;
@addamh
addamh / schema.sql
Created September 9, 2011 01:54
Database Schema for UofA Database Management Class Fall 2011
-- ----------------------------
-- Table structure for "customers"
-- ----------------------------
CREATE TABLE "customers" ( "c_id" NUMBER NOT NULL, "name" CHAR(10BYTE) NOT NULL, "phone" CHAR(13BYTE), "email" CHAR(15BYTE));
-- ----------------------------
-- Table structure for "furniture"
-- ----------------------------
CREATE TABLE "furniture" ( "f_id" NUMBER NOT NULL, "category" CHAR(20BYTE) NOT NULL, "style" CHAR(15BYTE) NOT NULL, "price" NUMBER(5,2) NOT NULL, CONSTRAINT "style" CHECK ("style" in ('modern', 'rustic', 'traditional')) ENABLE);
@addamh
addamh / lab3.a51
Created September 27, 2011 22:10
Assembly logic for stoplights at an intersection consisting of 2 one-way streets.
ORG 0
MOV P1, #0H
START:
JB P2.7, DIXON
JB P2.6, COLLEGE
NONE:
MOV P1, #0H