This file contains hidden or 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L] | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ index.php [QSA,L] |
This file contains hidden or 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": { | |
"twig/twig": "1.6.*", | |
"twig/extensions": "dev-master", | |
"slim/slim": "1.6.*", | |
"slim/extras": "1.0.*" | |
} | |
} |
This file contains hidden or 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
<?php | |
/** | |
* Model that handles the Stock quote. | |
*/ | |
class StockQuote extends AppModel { | |
/** | |
* update() - main method called by cron jobs and task schedulers to update | |
* latest stock quote information |
This file contains hidden or 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 Event | |
attr_reader :uid, :event_date, :sports | |
def initialize(args) | |
args.keys.each do |name| | |
instance_variable_set "@" + name.to_s, args[name] | |
end | |
end | |
end |
This file contains hidden or 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 'ostruct' | |
module MyModule | |
class MyClass < OpenStruct | |
end | |
end | |
#`<module:MyModule>': uninitialized constant OpenStruct (NameError) |
This file contains hidden or 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
event = [...] | |
@events = { | |
in_progress: events.select { |event| event.state == "in-progress" } || [], | |
pregame: events.select { |event| event.state == "pregame" } || [], | |
final: events.select { |event| event.state == "final" } || [] | |
} |
This file contains hidden or 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
<?php | |
namespace CI\Twig; | |
use Silex\Application; | |
class AssetTwigExtension extends \Twig_Extension | |
{ | |
private $CDN = null; |
This file contains hidden or 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
= render template: "layouts/sub_layout" | |
- content_for :content_body | |
h3 'action.html.slim' |
This file contains hidden or 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
describe 'ArticleDecorator' | |
describe '#opengraph_image_url' do | |
it 'should provide the default image as a fallback' do | |
request = stub(host: 'local.example.com', port: 3000) | |
ArticleDecorator.any_instance.stub request: request | |
ArticleDecorator.new(Article.new).opengraph_image_url.should == "http://local.example.com:3000/images/default.png" | |
end | |
end | |
end |
This file contains hidden or 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
Autotest.add_hook :initialize do |at| | |
%w{log coverage}.each {|exception| at.add_exception(exception)} | |
end |