Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
| module SingleRecipientSmtp | |
| def self.included(clazz) | |
| clazz.class_eval do | |
| cattr_accessor :single_recipient_smtp_settings | |
| end | |
| end | |
| def perform_delivery_single_recipient_smtp(mail) | |
| mail.to = single_recipient_smtp_settings[:to] | |
| mail.cc = nil |
| (function(d) { | |
| var dl = d.createElement('a'); | |
| dl.innerText = 'Download MP3'; | |
| dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; | |
| dl.download = d.querySelector('em').innerText+".mp3"; | |
| d.querySelector('.primary').appendChild(dl); | |
| dl.style.marginLeft = '10px'; | |
| dl.style.color = 'red'; | |
| dl.style.fontWeight = 700; | |
| })(document); |
| class UpgradeToRefineryTwo < ActiveRecord::Migration | |
| def self.up | |
| # For refinerycms-authentication | |
| rename_table :roles_users, :refinery_roles_users | |
| rename_table :roles, :refinery_roles | |
| rename_table :user_plugins, :refinery_user_plugins | |
| rename_table :users, :refinery_users | |
| remove_column :refinery_users, :persistence_token | |
| remove_column :refinery_users, :perishable_token | |
| remove_column :refinery_users, :remember_token |
| #!/bin/bash | |
| export TERM=xterm-color | |
| export CLICOLOR=1 | |
| export GREP_OPTIONS='--color=auto' | |
| # export LSCOLORS=Exfxcxdxbxegedabagacad | |
| export LSCOLORS=gxfxcxdxbxegedabagacad # Dark lscolor scheme | |
| # Don't put duplicate lines in your bash history | |
| export HISTCONTROL=ignoredups | |
| # increase history limit (100KB or 5K entries) | |
| export HISTFILESIZE=100000 |
Eventually platforms outgrow the single-source-tree model and become distributed systems. A common pattern in these distributed systems is distributed composition via event buffering. Here we motivate and describe this event buffering pattern.
| =begin | |
| # This RSpec Macro is for use with the authorization plugin CanCan. It lets you test that a controller checks for a | |
| # specific authorization, and if it fails, that the controller performs a certain action, such as redirecting to a | |
| # different page. | |
| # Example Usages in specs: | |
| it_should_authorize_access_for(:new, Company) | |
| it_should_authorize_access_for(:edit, Company.new) { get :edit, id: @company } | |
| # For more on using it_should_authorize_access_for, see comment block above the definition of it_should_authorize_access_for | |
| # in the code below. |
| require 'resque/server' | |
| resque_constraint = lambda do |request| | |
| request.env['warden'].authenticate? and request.env['warden'].user.admin? # or whatever manner your admin role can be determined | |
| end | |
| constraints resque_constraint do | |
| mount Resque::Server.new, :at => "/resque" | |
| end |