Skip to content

Instantly share code, notes, and snippets.

View rn0's full-sized avatar
:bowtie:
testing

Piotr Kapera rn0

:bowtie:
testing
View GitHub Profile
@rn0
rn0 / cw1.pov
Created November 13, 2008 18:09
#include "colors.inc"
#include "shapes.inc"
#include "textures.inc"
camera {
location <5, 9, -15>
look_at <0, 0, 0>
}
light_source {
/*
nawigacja pomiedzy nowymi komentarzami w wykop.pl
*/
$(document).ready(function() {
ids = [];
$('ul#wykop-comments div.comment-body-new').parent('li').each(function() {
ids.push($(this).attr('id'));
});
cnt = ids.length;
if(cnt > 0) {
<?php
class BrokenDescrFilter extends FilterIterator {
public function __construct(Iterator $iterator) {
parent::__construct($iterator);
}
public function accept() {
$file = $this->getInnerIterator()->current();
if($file->getSize() == 18) {
run lambda { |env| [200, {'Content-Type'=>'text/plain'}, "Hello World! - #{Time.now} \n"] }
#http://www.ruby-forum.com/topic/188417
age = 25
# 1. use the other block form
category = case
when age < 12 : "child"
when (13..17) === age : "minor"
when (18..24) === age : "young ad*lt"
sudo su
tce-load -wi cfdisk.tcz
tce-load -wi grub-0.97-splash.tcz
cfdisk /dev/hda
mkfs.ext3 /dev/hda1
rebuildfstab
mount /mnt/hda1
mkdir -p /mnt/hda1/boot/grub
@rn0
rn0 / application.rb
Created June 19, 2011 18:51 — forked from robertsosinski/application.rb
A simple way to manage multiple parameters in Rails routing
before_filter :hash_options
def hash_options
params[:options] = Hash[*((params[:options].size % 2) == 0) ? params[:options] : (params[:options] + [nil])] if params[:options]
end
require 'spec_helper'
describe User do
describe "Object Attributes" do
before(:each) { @obj = User.new }
specify { @obj.should respond_to(:first_name) }
specify { @obj.should respond_to(:last_name) }
specify { @obj.should respond_to(:login) }
end