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
module Modules | |
class OrderPdf | |
include ActionView::Rendering | |
def initialize(order) | |
@order = order | |
@view = ActionView::Base.new(ActionController::Base.view_paths, {}) | |
@view.extend(ApplicationHelper) | |
@view.extend(AbstractController::Rendering) | |
@view.extend(Rails.application.routes.url_helpers) |
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 'yaml' | |
require 'erb' | |
require 'ostruct' | |
class Settings < OpenStruct | |
# Settings.new(:google_analytics) | |
def initialize(config_file_base_name) | |
super(YAML.load(ERB.new(File.read(Rails.root.join("config", "#{config_file_base_name}.yml"))).result)[Rails.env]) | |
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
*.db | |
*.swp |
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 basedir="." default="package" name="PROJECT_NAME"> | |
<!-- | |
This script assumes: | |
1) CATALINA_HOME environment variable points to tomcat's directory | |
2) Following Folder Structure | |
./ (project root) | |
|- src/ (project.src.dir - source folder) | |
|- build/ | |
| |- classes/ (project.classes.dir) |
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
'use strict'; | |
module.exports = function(grunt) { | |
// load all grunt tasks | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
// configurable paths | |
var paths = { |
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
<li class="<%= self_or_other(message) %>"> | |
<div class="avatar"> | |
<img src="http://placehold.it/50x50" /> | |
</div> | |
<div class="chatboxmessagecontent"> | |
<p><%= message.body %></p> | |
<time datetime="<%= message.created_at %>" title="<%= message.created_at.strftime("%d %b %Y at %I:%M%p") %>"> | |
<%= message_interlocutor(message).name %> • <%= message.created_at.strftime("%H:%M %p") %> | |
</time> | |
</div> |
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 Event < ActiveRecord::Base | |
attr_accessible :_timed, :details, :end_date, :start_date, :text | |
# From http://www.dhtmlx.com/docs/products/dhtmlxScheduler/xml/events.xml | |
def to_xml (options = {}) | |
options[:indent] ||= 2 | |
xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent]) | |
xml.instruct! unless options[:skip_instruct] | |
xml.event(:id => id, :timed => _timed) do | |
xml.text text |
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 | |
sudo apt-get update | |
# Install Basics | |
# build-essential needed for "make" command | |
sudo apt-get install -y build-essential software-properties-common \ | |
vim curl wget tmux | |
# Install PHP 5.6 | |
sudo add-apt-repository -y ppa:ondrej/php5-5.6 |
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
# If you'd like this packaged up as a gem, send me a note. You can get | |
# in touch with me at http://www.techiferous.com/about | |
require 'nokogiri' | |
require 'ispell' | |
module Rack | |
class SpellCheck | |
def initialize(app, options = {}) |
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
module Rack | |
# A rack middleware for validating HTML via w3c validator | |
class Validate | |
def initialize( app ) | |
@app = app | |
end | |
def call( env ) |