Skip to content

Instantly share code, notes, and snippets.

// Read input from the console
public void readFromConsole()
{
Scanner console = new Scanner(System.in);
while (console.hasNext())
{
// Do something
}
console.close();
}
# 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
alias backup_work='rsync -avz -e ssh --partial --delete /Users/username/Work/ user@remote:/home/user/Backups/Work'
/**
* Main module for verifying Distance. Prints results to STDOUT
*/
#import "Distance.h"
#include <stdlib.h>
int main(int argc, char *argv[])
{
// Initalise three instances.
<!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 {
for i in (1..10).to_a do
x = i
end
puts x #=> 10
(1..10).to_a.each do |i|
y = i
end
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
# Why spaces are important
validates_presence_of :attr1,
:attr2,
:attr3
validates_presense_of :attr1,
:attr2,
:attr3
# Mini Magick VS Image Science
require 'benchmark'
require 'rubygems'
require 'mini_magick'
require 'image_science'
@count = 0
def create_mini_magick_thumbnail
@tatey
tatey / factorial
Created July 21, 2009 12:13
Factorial in assembly (M6800)
; 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