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
# Speed things up by not loading Rails env | |
config.assets.initialize_on_precompile = false |
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 'twitter' | |
require "json" | |
USERNAME = 'YOUR_TWITTER_USER_NAME' | |
ARCHIVE_PATH = 'archive/data/js/tweets' | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = 'TWITTER_APP_API_KEY' | |
config.consumer_secret = 'TWITTER_APP_API_SECRET' | |
config.access_token = 'TWITTER_APP_ACCESS_TOKEN' |
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
# lib/paperclip_processors/transparency.rb | |
module Paperclip | |
class Transparency < Thumbnail | |
# Find the background and replace with transparency. | |
# -fuzz 20% simulates antialiasing | |
CONVERT_OPTIONS = [ | |
'-alpha', 'set', | |
'-fill', 'white', | |
'-draw', "'color 0,0 replace'", |
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
<%= f.input :email, | |
wrapper: :semantic_icon_input, | |
label: false, | |
required: true, | |
placeholder: t('users.form.placeholder.email'), | |
left_icon: 'user' %> |
This is a simplified, but fairly thorough, set of scripts and configuration to enable Heroku Release Phase for Rails apps.
Further, this particular set up plays nicely with Heroku Review Apps in that the release
phase script will:
- Fail, loudly, if the DB does not yet exist.
- Load the DB schema if the current schema version (as determined by
bin/rails db:version
) is0
. - Run DB migrations otherwise.
For a "normal" app that usually means it will run the DB migrations.
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
# This is a workaround for the rails issue described in | |
# https://github.com/rails/rails/issues/17368. If you use this, | |
# make sure you understand its code and what it does and what it | |
# doesn't. | |
# | |
# See below for an example. | |
# lib/lazy_ids.rb (i.e.) | |
module LazyIds | |
extend ActiveSupport::Concern |
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
// Lambda S3 Zipper | |
// http://amiantos.net/zip-multiple-files-on-aws-s3/ | |
// | |
// Accepts a bundle of data in the format... | |
// { | |
// "bucket": "your-bucket", | |
// "destination_key": "zips/test.zip", | |
// "files": [ | |
// { | |
// "uri": "...", (options: S3 file key or URL) |
OlderNewer