$ brew install ack
$ ack --version
Create ~/.ackrc (Below is my ackrc example, modify as you see fit)
# Options
--smart-case
--sort-files
\A(\d{4})(-?)(\d{2})\2(\d{2})(?:[T\s-](\d{2})(:?)(\d{2})(?:\6(\d{2}))?)?\z |
#!/bin/sh | |
# Update latest epel | |
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
sudo rpm -Uvh epel-release-6-8.noarch.rpm | |
# Download and build mosh | |
sudo yum -y install rpm-build rpmdevtools protobuf-compiler protobuf-devel libutempter-devel zlib-devel ncurses-devel openssh-clients perl-IO-Tty openssl-devel gcc gcc-c++ | |
rpmdev-setuptree | |
cd ~/rpmbuild/SOURCES |
require 'benchmark' | |
root_directories = Dir.glob("/*") | |
n = 5000 | |
Benchmark.bm do |x| | |
x.report("sort") do | |
n.times{ root_directories.sort { |a, b| File.ctime(a) <=> File.ctime(b) } } | |
end |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body ng-app='testScope'> | |
<div ng-controller='BankController'> | |
<div transaction> |
case class Mascot(name: String) | |
case class SportTeam(mascot: Mascot) | |
case class City(sportTeams: List[SportTeam]) | |
case class State(cities: List[City]) | |
case class Country(states: List[State]) | |
def getAllMascots(country: Country): List[Mascot] = { | |
for { | |
states <- country.states | |
cities <- states.cities |
def possible_reps(input) | |
lambda {|k,_| k <= input} | |
end | |
def build_roman(input) | |
lambda do |result, (arabic, roman)| | |
if (input >= arabic) | |
quotient, input = input.divmod(arabic) | |
result << roman*quotient | |
end |
require 'matrix' | |
matrix = Matrix[ | |
[9, 2, 8, 6], | |
[5, 3, 1, 5], | |
[6, 8, 7, 9] | |
] | |
cols = matrix.column_vectors | |
rows = matrix.row_vectors |
require 'matrix' | |
cups_per_student_per_row = 2 | |
plants = %w( G C R V ) | |
students = %w( Alice Bob Charlie David Eve Fred Ginny Harriet Ileana Joseph Kincaid Larry ).sort | |
layout = Matrix[ | |
24.times.map{ plants.sample }, | |
24.times.map{ plants.sample } | |
] |
var say = function(msg) { | |
var speech = new SpeechSynthesisUtterance(); | |
var voices = window.speechSynthesis.getVoices(); | |
speech.voice = voices[10]; // 'en-AU' 'Karen' | |
speech.text = msg; | |
speech.onend = function(e) { | |
console.log('Finished in ' + event.elapsedTime + ' seconds.'); | |
}; |