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
/** | |
Writes a sandboxed block of HTML to the supplied node. | |
<p>Based on an example from <a href="https://github.com/RCanine/embed-code">Meebo</a>.</p> | |
@method writeSandboxedHTML | |
@namespace RC | |
@param {String} width a valid CSS width | |
@param {String} height a valid CSS height | |
@param {String} html a block of HTML code |
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
// | |
// Example usage: phantomjs screenshot.js http://yahoo.com /tmp/yahoo.png | |
// | |
var system = require('system'); | |
var url = system.args[1]; | |
var filename = system.args[2]; | |
var page = new WebPage(); | |
page.open(url, function (status) { |
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
# Simple approach to sending email from the Rails console | |
# Implementation idea courtesy of Steve Klabnik | |
# http://blog.steveklabnik.com/posts/2012-09-09-random-ruby-tricks--class-new | |
# Create the mailer class with a block and assign to a variable | |
mailer = Class.new(ActionMailer::Base) do | |
def example_message | |
mail(to: "[email protected]", from: "[email protected]", subject: "Example Message") do |format| | |
format.text { render text: "Example message body" } | |
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
#!/bin/bash | |
set -exo pipefail | |
BUILD_ENV=$1 | |
if [ `uname` == 'Darwin' ]; then | |
OSX=1 | |
JSCOMPRESSOR="yuicompressor --type js" | |
else | |
OSX= |