Skip to content

Instantly share code, notes, and snippets.

View RaVbaker's full-sized avatar
drinking coffee

Rafal Piekarski RaVbaker

drinking coffee
View GitHub Profile
#!/usr/bin/env ruby
# encoding: UTF-8
#
# LearnRubyByExample:
#
# Ruby is a highly expressive programming language.
# Testing software is an expressive way to communicate how it works.
#
# In the middle of a night awake for allergy and insomnia, and some days after the 1st _why day,
# I've tried to combine Ruby and testing to help teaching ruby with some goals in mind:
@madrobby
madrobby / annotated.js
Created May 17, 2011 12:44 — forked from 140bytes/LICENSE.txt
Unit testing
function(
a, // a object holding test functions
b, // a logging function, taking multiple arguments
c, // placeholder
d, // placeholder
e, // placeholder
f // placeholder
){
c = d = e = 0; // initialize asserts, failures and exception counts to 0
for ( // iterate
@madrobby
madrobby / LICENSE.txt
Created May 19, 2011 14:46 — forked from 140bytes/LICENSE.txt
Mock objects
Copyright (c) 2011 Thomas Fuchs, http://mir.aculo.us/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@RaVbaker
RaVbaker / .bash_profile
Last active September 26, 2015 19:08
My private .bashrc file.
export PATH="/usr/local/mysql/bin:~/bin:$PATH"
homebrew=/usr/local/bin:/usr/local/sbin
export PATH=$homebrew:$PATH
export JSTESTDRIVER_HOME="/Users/ravbaker/projekty/jstest"
export NODE_PATH="/usr/local/lib/node:/usr/local/lib/node_modules"
export BUNDLER_EDITOR="subl"
export EDITOR="vim"
test "$TERM" == 'xterm-color' && [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
@metaskills
metaskills / wait_until.rb
Last active May 2, 2024 01:51
Never sleep() using Capybara!
# WAIT! Do consider that `wait` may not be needed. This article describes
# that reasoning. Please read it and make informed decisions.
# https://www.varvet.com/blog/why-wait_until-was-removed-from-capybara/
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
@dionyziz
dionyziz / peano.js
Created August 28, 2011 16:05
Javascript Peano Arithmetic from thin air
// peano.js - Javascript Peano Arithmetic from thin air
// Developer: Dionysis "dionyziz" Zindros <dionyziz@gmail.com>
//
// This is an illustration of how it is possible to construct the system of arithmetic
// on non-negative integers in Javascript without requiring any underlying arithmetic code by the host language.
// The system is based purely on the underlying logic of the language; that is, "if", "and", "or",
// "not" and the equals operator "==", as well as the logical constants true and false;
// those logical constants, incidentally, can be obtained by issuing "null == null" and "!( null == null)"
// respectively, so they are not required to be defined. Indeed, observe the following alternative:
//
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@maccman
maccman / gist:1232164
Created September 21, 2011 14:23 — forked from tvandervossen/gist:1231476
Mobile Safari viewport sizes on iOS 4.3 and 5
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3
@RaVbaker
RaVbaker / iOS5_update_checker.command
Created October 12, 2011 15:40
iOS5 software update notifier
#! /bin/csh
while (1)
curl -s -L http://phobos.apple.com/version | grep -i Restore | grep -i "\(iPhone\|iPad\|iPod\)" | grep -i "5\.0"
if ($? == 1) then
echo "Nothing yet..."`date`
else
say "iOS FIVE POINT OH FIRMWARE IS NOW AVAILABLE"
endif
sleep 13
end
@jewilmeer
jewilmeer / RubyTest.sublime-build
Created January 6, 2012 12:08
Sublime 2 with .rvmrc loading
// This file lives @ /Library/Application Support/Sublime Text 2/Packages/User/RubyTest.sublime-build
{
"ruby_unit_exec": "~/bin/rvm_ruby ruby -Itest",
"ruby_cucumber_exec": "~/bin/rvm_ruby cucumber --no-color",
"ruby_rspec_exec": "~/bin/rvm_ruby rspec",
"ruby_unit_folder": "test",
"ruby_cucumber_folder": "features",
"ruby_rspec_folder": "spec"
}