This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read input from the console | |
public void readFromConsole() | |
{ | |
Scanner console = new Scanner(System.in); | |
while (console.hasNext()) | |
{ | |
// Do something | |
} | |
console.close(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Macports | |
export PATH=/opt/local/bin:/opt/local/sbin:$PATH | |
export MANPATH=/opt/local/share/man:$MANPATH | |
# Git-core bash completion | |
if [ -f /opt/local/etc/bash_completion ]; then | |
. /opt/local/etc/bash_completion | |
fi | |
# Use TextMate as default editor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias backup_work='rsync -avz -e ssh --partial --delete /Users/username/Work/ user@remote:/home/user/Backups/Work' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Main module for verifying Distance. Prints results to STDOUT | |
*/ | |
#import "Distance.h" | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) | |
{ | |
// Initalise three instances. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html lang='en-US' xml:lang='en-US' xmlns='http://www.w3.org/1999/xhtml'> | |
<head> | |
<title>IE float bug</title> | |
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' /> | |
<style type='text/css'> | |
body { | |
font-family: Helvetica, sans-serif; } | |
#container, #left, #right1, #right2 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in (1..10).to_a do | |
x = i | |
end | |
puts x #=> 10 | |
(1..10).to_a.each do |i| | |
y = i | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module GemManager | |
class Base | |
def initialize | |
@gems = {} | |
output = `gem list -l` | |
output.each_line do |line| | |
installed_gem = parse(line, true) | |
@gems[installed_gem.name] = installed_gem | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Why spaces are important | |
validates_presence_of :attr1, | |
:attr2, | |
:attr3 | |
validates_presense_of :attr1, | |
:attr2, | |
:attr3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mini Magick VS Image Science | |
require 'benchmark' | |
require 'rubygems' | |
require 'mini_magick' | |
require 'image_science' | |
@count = 0 | |
def create_mini_magick_thumbnail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Course: 1007ICT - Griffith University | |
; Assignment: 2 | |
; Author: Tate Johnson | |
; Created: 2008-05-30 | |
; Processor: Motorola 6800 | |
; QUESTION 6 | |
; Calculate factorial of a | |
; number ranging from 1 - 8, | |
; depending on desired value |