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
CarrierWave.configure do |config| | |
config.storage = :fog | |
config.fog_credentials = { | |
provider: 'AWS', | |
aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'], | |
aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'], | |
region: ENV['FOG_REGION'] | |
} | |
config.fog_directory = ENV['S3_BUCKET_NAME'] | |
end |
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
// new ParamsHandler({ location_id: object.id, page: 1 }).redirect(); | |
window.ParamsHandler = (function() { | |
function ParamsHandler(params) { | |
this.params = params; | |
this.kvp = document.location.search.substr(1).split('&'); | |
} | |
ParamsHandler.prototype.redirect = function() { | |
this._mapParams(); |
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
window.Humanize = | |
# Humanize.numberToCurrency(100) => "$100" | |
# Humanize.numberToCurrency(10000) => "$10,000" | |
# Humanize.numberToCurrency(50.0501) => "$50.0501" | |
# Humanize.numberToCurrency(50.0501, { precision: 2 }) => "$50.05" | |
# Humanize.numberToCurrency(50, { unit: '£' }) => "£50" | |
# Humanize.numberToCurrency(10000, { delimiter: ';' }) => "$10;000" | |
numberToCurrency: (number, paramsOptions={})-> | |
defaultOptions = |
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
window.Humanize = { | |
// Humanize.numberToCurrency(100) => "$100" | |
// Humanize.numberToCurrency(10000) => "$10,000" | |
// Humanize.numberToCurrency(50.0501) => "$50.0501" | |
// Humanize.numberToCurrency(50.0501, { precision: 2 }) => "$50.05" | |
// Humanize.numberToCurrency(50, { unit: '£' }) => "£50" | |
// Humanize.numberToCurrency(10000, { delimiter: ';' }) => "$10;000" | |
numberToCurrency: function(number, paramsOptions) { | |
var defaultOptions, delimited, delimiter, fixed, options, precision, unit; |
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
// Define animation name, and properties | |
/* | |
@include keyframes(fade-out) { | |
0% { opacity: 1; } | |
90% { opacity: 0; } | |
} | |
*/ | |
@mixin keyframes($animation-name) { | |
@-webkit-keyframes #{$animation-name} { | |
@content; |
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
# new BackgroundPrint('http://book.pdf').print() | |
class window.BackgroundPrint | |
constructor: (url)-> | |
@url = url | |
print: -> | |
@_createFrame() | |
@_handleFrameLoad() | |
@_loadFrame() | |
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
pg_dump --schema='source_schema' database_name | sed 's/source_schema/destination_schema/g' | psql -d database_name |
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
// Get current date time | |
var currentDate = new Date(); | |
// get date | |
var date = currentDate.getDate(); | |
// get month index (January is 0) | |
var month = currentDate.getMonth(); | |
// get year |
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
namespace :nondigest do | |
desc "TODO" | |
task precompile: :environment do | |
fingerprint = /\-[0-9a-f]{64}\./ | |
filemap = {} | |
Dir["public/assets/**/*"].each do |file| | |
next if file !~ fingerprint | |
next if File.directory?(file) | |
nondigest = file.sub fingerprint, '.' |
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
/* | |
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request | |
- Or, request confirmation in the process - | |
<a href="posts/2" data-method="delete" data-confirm="Are you sure?"> | |
*/ | |
(function() { |
OlderNewer