This file contains 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
require 'benchmark' | |
n = 500_000 | |
Benchmark.bm(7) do |x| | |
x.report('append:') do | |
a = '' | |
n.times { a << 'a' } | |
end | |
x.report('+=:') do |
This file contains 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
chrismar035:super_sweet_project(master) $ git lg | |
* 99f0b00 - LOST COMMIT!!! (just now) <Chris Marshall> | |
* faa7737 - Merge branch 'features/sweet_feat' (1 day ago) <Chris Marshall> | |
|\ | |
| * 3ce8e66 - Commit after the lost one (1 day ago) <Chris Marshall> | |
| * 9418734 - Commit before the lost one (1 day ago) <Chris Marshall> | |
|/ | |
* b67ec4c - Other unrelated commit (2 days ago) <Chris Marshall> | |
... |
This file contains 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
<html> | |
<head> | |
<title>John Doe's web page</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
// Use a popup box here to read the user name | |
// and write a personalized greeting | |
{ | |
var name=prompt("Please enter your name","Harry Potter"); |
This file contains 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
# I didn't write this and I'm not sure where it came from... | |
# Add an "alert" alias for long running commands. Use like so: | |
# sleep 10; alert | |
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' | |
This file contains 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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
if [ -n "$PS1" ] ; then | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# ... or force ignoredups and ignorespace | |
HISTCONTROL=ignoredups:ignorespace |
This file contains 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
require 'fileutils' | |
require 'rubygems' | |
require 'pony' | |
# Set absolute path for config file directory | |
conf_path = "/home/auto-responses" | |
#for each config file (autoresponder) | |
Dir.new(conf_path).each do |response_file| |
This file contains 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
puts "How many players?" | |
players = gets.chomp.to_i | |
puts "How many items?" | |
items = gets.chomp.to_i | |
(1..players).each do |i| | |
puts "card #{i}" | |
card = Array.new | |
(1..5).each do |row| | |
print " " | |
(1..5).each do |col| |
This file contains 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
Setting up NACHOS in Ubuntu Linux | |
1) Download and Extract the nachos-java.tar.gz | |
2) Install sun-java6-jdk package. (sudo apt-get install sun-java6-jdk) | |
3) Add the nachos executable to your PATH, by adding the following lines to your ~/.profile file. | |
if [ -d "$HOME/nachos/bin" ] ; then | |
PATH="$HOME/nachos/bin:$PATH" | |
fi |
This file contains 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
Foxmarks | |
Tree Style Tabs | |
Greasemonkey | |
Greasefire | |
Firebug | |
Enter Selects | |
Delicious Bookmarks | |
Download Statusbar | |
FlashBlock |
This file contains 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
" Modified from An example for a vimrc file. | |
" | |
" Maintainer: Bram Moolenaar <[email protected]> | |
" Last change: 2008 Dec 17 | |
" | |
" To use it, copy it to | |
" for Unix and OS/2: ~/.vimrc | |
" for Amiga: s:.vimrc | |
" for MS-DOS and Win32: $VIM\_vimrc | |
" for OpenVMS: sys$login:.vimrc |