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
<div id="post"> | |
<h2>{{ post.title }}</h2> | |
<span class="date">{{ post.date | date_to_string }}</span> | |
{{ post.content }} | |
</div> | |
Results in... | |
<div id="post"> | |
<h2>Another Test</h2> |
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 String | |
def to_r | |
ends = self.split('..').map{|d| Integer(d)} | |
if ends.size > 1 | |
ends[0]..ends[1] | |
else | |
ends[0] | |
end | |
end | |
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
require 'test_helper' | |
class FicTest < ActiveSupport::TestCase | |
should_belong_to :user | |
should_belong_to :story | |
should_validate_presence_of :content | |
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
require 'test_helper' | |
class FicTest < ActiveSupport::TestCase | |
fixtures :all | |
should_belong_to :user | |
should_belong_to :story | |
test "should validate presence of content" do | |
assert_raise (ActiveRecord::RecordInvalid) { |
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
--# Main | |
-- based on untextured raycaster example: http://lodev.org/cgtutor/raycasting.html | |
MAPWIDTH = 24 | |
MAPHEIGHT = 24 | |
worldMap = { | |
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, | |
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, | |
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, |
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
--# Counter | |
CTYPE_WHITE = 0 | |
CTYPE_BLACK = 1 | |
CTYPE_PLACEWHITE = 2 | |
CTYPE_PLACEBLACK = 3 | |
Counter = class() | |
function Counter:init(x, y, t) | |
self.pos = vec2(x,y) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<project> | |
<app title="Flixel Test" file="Flixel Test" main="Main" version="0.0.1" company="Zaphod" /> | |
<window width="1024" height="768" fps="30" orientation="portrait" resizable="true" if="target_flash" /> | |
<window width="0" height="0" fps="30" orientation="landscape" fullscreen="true" unless="target_flash" /> | |
<set name="BUILD_DIR" value="Export" /> | |
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
@implementation ADNClient | |
+ (id)sharedClient | |
{ | |
static dispatch_once_t pred = 0; | |
__strong static id _sharedObject = nil; | |
dispatch_once(&pred, ^{ | |
_sharedObject = [[self alloc] init]; | |
}); | |
return _sharedObject; |
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
// | |
// BeerTests.m | |
// Beer | |
// | |
// Created by Marin Usalj on 5/16/13. | |
// Copyright 2013 @mneorr | mneorr.com. All rights reserved. | |
// | |
#import "Kiwi.h" |
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 ReceiptParser | |
attr_reader :counts, :prices | |
def initialize(currency_symbol) | |
if (currency_symbol == "") then currency_symbol = "£" end | |
@currency_symbol = currency_symbol | |
@all_items = [] | |
@counts = { :ios_apps => 0, :iaps => 0 } | |
@prices = { :ios_apps => 0, :iaps => 0 } | |
end |
OlderNewer