#Testing
- Tape
To the point testing tool that will keep tests you write simple and effective. Integrates with Karma and Phantom JS for browser testing.
- Ava
var express = require('express'), | |
app = express(), | |
port = process.env.PORT || 3000; | |
var listener = app.listen(port, () => { | |
console.info("==> ✅ Server is listening"); | |
console.info("==> 🌎 Go to localhost:%s", port); | |
}); | |
app.route('/') |
#Testing
To the point testing tool that will keep tests you write simple and effective. Integrates with Karma and Phantom JS for browser testing.
namespace :codebase do | |
desc "Logs the deployment of your Codebase 4 repository" | |
task :log_deployment do | |
previous_revision = fetch :previous_revision | |
current_revision = fetch :current_revision | |
if previous_revision == current_revision | |
puts "\e[31m The old revision & new revision are the same - you didn't deploy anything new. Skipping logging.\e[0m" | |
next |
<?php | |
$start_at = '2012-11-15'; | |
$end_at = strtotime('2012-11-15'); | |
$final_date = strtotime('2013-01-22'); | |
$dates = array(); | |
# Calculate intervals. | |
while($end_at < $final_date){ | |
class CartesianProduct | |
include Enumerable | |
def initialize(a,b) | |
@values = [] | |
@values = a.product(b) unless b.empty? | |
end | |
def each(&block) | |
@values.each {|v| yield v} |
class Class | |
def attr_accessor_with_history(attr_name) | |
attr_name = attr_name.to_s # make sure it's a string | |
attr_reader attr_name # create the attribute's getter | |
attr_reader attr_name + "_history" #create history getter | |
class_eval %{ | |
def #{attr_name}=(val) | |
@#{attr_name} = val | |
@#{attr_name}_history = [nil] if @#{attr_name}_history.nil? |