This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name "rails" | |
description "rails development environment" | |
window "editor", selected: true do | |
command "vim ." | |
split :horizontal, height: 20 | |
split :vertical do | |
dir "~/code/hotrod" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Davis.hash = function () { | |
var handlers = [], | |
lastPolledLocation | |
var triggerHandlers = function (request) { | |
Davis.utils.forEach(handlers, function (handler) { | |
handler(request) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window :editor do | |
command "vim ." | |
end | |
window :shell | |
window :console do | |
command "irb" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<script src="https://raw.github.com/olivernn/davis.js/modifier-keys/davis.js"></script> | |
<a href="/foo">Foo</a> | |
<a href="/bar">Bar</a> | |
<script> | |
Davis(function () { | |
this.get('/foo', $.noop) | |
this.get('/bar', $.noop) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assuming a 'document' strucutre like below to represent a single icon | |
{ | |
"id": "some-unique-id", | |
"tags": ["tag1", "tag2", "tag3"], | |
"title": "My Awesome Icon" | |
} | |
// You can then set up an index with the following, I put a boost on the tags, but it depends on your data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'date' | |
class Commit | |
attr_reader :sha, :author, :date | |
def initialize(attributes = {}) | |
@sha = attributes[:sha] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Davis tests</title> | |
<!-- dependencies --> | |
<script src="/tests/javascripts/jquery.js"></script> | |
<!-- davis --> | |
<script src="/davis.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] | |
/path/to/log/*.log 644 0 5120 * GN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
words = File.open('/usr/share/dict/words', 'r') do |file| | |
file.each_line.take(100_000).map(&:chomp) | |
end | |
Benchmark.bmbm(20) do |x| | |
GC.start | |
x.report("map") do | |
words.map do |word| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Duration | |
include Comparable | |
attr_reader :milliseconds | |
def initialize(value = 0) | |
case value | |
when Fixnum | |
@milliseconds = value | |
when String |