Skip to content

Instantly share code, notes, and snippets.

View janxious's full-sized avatar
🌰
.

Joel "The Gregarious" Meador janxious

🌰
.
View GitHub Profile
@janxious
janxious / fizzbuzz.exs
Last active August 29, 2015 14:12
FizzBuzz Elixir
fizzer = fn
(0,0,_) -> "FizzBuzz"
(0,_,_) -> "Fizz"
(_,0,_) -> "Buzz"
(_,_,n) -> n
end
fizzbuzz = fn(n) ->
fizzer.(rem(n,3), rem(n,5), n)
end
@janxious
janxious / roman_numeral.exs
Created April 19, 2015 18:14
Elixir: Roman Numerals
defmodule RomanNumeral do
@numerals [
{50, "L"},
{40, "XL"},
{10, "X"},
{9, "IX"},
{5, "V"},
{4, "IV"},
{1, "I"}
]
@janxious
janxious / 01.html
Last active August 29, 2015 14:24
Automatic PDF Footnotes
<html>
<head>
<style type="text/css">
@page { size: A6; } /* Basic style for easier demonstration */
body { font-family: Verdana; } /* Basic style for easier demonstration */
.footnote {
float: footnote;
}
</style>
@janxious
janxious / Notes About Ruby Hoedown
Created September 3, 2009 18:06
Ruby Hoedown 2009 Notes
Cucumber Talk - 9AM Fri - Ben Mabey - benmabey.com
placing emphasis on features instead of overall product goals
check wip in cucumber; can limit the number of tests to use with a given tag?
Check out webrat
"specify outcome, not implementation"
<%# Total number of tickets for this customer by time frame -%>
<table>
<thead>
<tr>
<th>Timeframe</th>
<th>Opened</th>
<th>Closed</th>
</tr>
</thead>
<tbody>
#!/usr/bin/env ruby
# this script can be used to find out what colours will look like on your terminal all in one go
module TermColours
@attributes = [0,1,4,5,7]
@foregrounds = 30..37
@backgrounds = 40..47
def self.print_all_attribute_foreground_background_combinations
@attributes.each do |attr|
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
application/atom+xml atom;
application/rss+xml rss;
#!/usr/bin/env ruby
# this script can be used to find out what colours will look like on your terminal all in one go
module TermColours
@attributes = [0,1,4,5,7]
@foregrounds = 30..37
@backgrounds = 40..47
def self.print_all_attribute_foreground_background_combinations
@attributes.each do |attr|
@janxious
janxious / propane - cf_chat.css
Created January 28, 2010 19:47
some css for styling propane
#upload_target {
display:none ! important;
}
div.bottom {
padding:0px ! important;
margin:0px ! important;
background-image: none ! important;
}
div#last_message{
display:none ! important;
@janxious
janxious / activesupport.rb
Created January 31, 2010 22:07 — forked from expectedbehavior/activesupport.rb
Test::Unit Cucumber-style Tagging
module ActiveSupport
module Testing
module Declarative
alias :tu_test_original :test
# test "verify something", [:slow, :wip] do
# ...
# end
def test(name, tags = nil, &block)