Skip to content

Instantly share code, notes, and snippets.

View hypomodern's full-sized avatar

Matt Wilson hypomodern

View GitHub Profile
@xaviershay
xaviershay / build_frontend.sh
Last active December 24, 2015 20:49
SASS + Coffee + Concatenation in prod
#!/bin/bash
set -exo pipefail
BUILD_ENV=$1
if [ `uname` == 'Darwin' ]; then
OSX=1
JSCOMPRESSOR="yuicompressor --type js"
else
OSX=
@barelyknown
barelyknown / gist:3692433
Created September 10, 2012 17:42
Send Email From Rails Console
# 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
@javan
javan / screenshot.js
Created June 19, 2012 21:40
Create a screenshot of any URL using phantomjs (headless webkit)
//
// 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) {
@kara-ryli
kara-ryli / write-sandboxed-html.js
Created June 13, 2012 19:14
Write arbitrary HTML into an iframe sandbox. Useful for untrusted 3rd-party code (e.g. ads).
/**
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