Input file:
$ cat foo
qwe
123
bar
require 'colored' | |
def banner(title, pad = 85) | |
puts "\n#{title} ".ljust(pad, "*").yellow | |
end | |
def stripe | |
puts ("-" * 84 + "\n").yellow | |
end | |
// Finds the longest common starting substring in an array of strings | |
function common_substring(data) { | |
var i, ch, memo, idx = 0 | |
do { | |
memo = null | |
for (i=0; i < data.length; i++) { | |
ch = data[i].charAt(idx) | |
if (!ch) break | |
if (!memo) memo = ch | |
else if (ch != memo) break |
/** | |
* Annoying.js - How to be an asshole to your users | |
* | |
* DO NOT EVER, EVER USE THIS. | |
* | |
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com) | |
* Visit https://gist.github.com/767982 for more information and changelogs. | |
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog | |
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors | |
* |
namespace :test do | |
task :populate_testopts do | |
if ENV['TESTNAME'].present? | |
ENV['TESTOPTS'] = ENV['TESTOPTS'] ? "#{ENV['TESTOPTS']} " : '' | |
ENV['TESTOPTS'] += "--name=#{ENV['TESTNAME'].inspect}" | |
end | |
end | |
end | |
%w(test:units test:functionals test:integration).each do |task_name| |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |