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
def test_code | |
puts "Yay!" | |
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
# I've been wondering about a pattern-matching-driven approach to what we've been talking about, e.g. | |
def parse_command(input) do | |
input | |
|> String.strip | |
|> match_command | |
end | |
def match_command("north"), do: {Player, :move, [:north, player, world]} | |
def match_command("east"), do: {Player, :move, [:east, player, world]} |
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
defmodule StringToIntegerBench do | |
use Benchfella | |
@word "string" | |
@integer "1234" | |
bench "regex for word" do | |
if numeric_string?(@word) do | |
@word |> String.to_integer | |
else |
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,Email,Role,Group: Test Group 1,Group: Test Group 2,Group: Test Group 3,Custom: Test Custom Field | |
Test User 1,[email protected],learner,yes,yes,yes,oranges | |
Test User 2,[email protected],learner,yes,yes,yes,oranges | |
Test User 3,[email protected],learner,yes,yes,yes,oranges | |
Test User 4,[email protected],learner,yes,yes,yes,oranges | |
Test User 5,[email protected],learner,yes,yes,yes,oranges | |
Test User 6,[email protected],learner,yes,yes,yes,oranges | |
Test User 7,[email protected],learner,yes,yes,yes,oranges | |
Test User 8,[email protected],learner,yes,yes,yes,oranges | |
Test User 9,[email protected],learner,yes,yes,yes,oranges |
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 'ruby-jmeter' | |
test do | |
defaults domain: 'beta.stevegrossi.com' | |
cookies clear_each_iteration: true |
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
#!/bin/bash | |
MESSAGE=$(git log -1 HEAD --pretty=format:%s) | |
say -v "Zarvox" "$MESSAGE" |
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 Image < ActiveRecord::Base | |
attr_accessible :custom_file_name | |
has_attached_file :attachment | |
after_save :rename_attached_file, if: :rename_necessary? | |
def rename_attached_file | |
(attachment.styles.keys).each do |style| |