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
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" |
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
module Posts | |
class PublishOperation < BaseOperation | |
attribute :post_id, Types::Strict::String | |
attribute :publish_on, Types::Strict::DateTime | |
def call! | |
guard! | |
validate! | |
publish | |
post.apply_post_published(event) |
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
# frozen_string_literal: true | |
require 'openssl' | |
class Cipher | |
def initialize(klass:, id:, key:) | |
@cipherable_type = klass.name | |
@cipherable_id = id | |
@key = Base64.decode64(key) | |
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
if [ -f `brew --prefix`/etc/bash_completion ]; then | |
. `brew --prefix`/etc/bash_completion | |
fi | |
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" |
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
if [ -f `brew --prefix`/etc/bash_completion ]; then | |
. `brew --prefix`/etc/bash_completion | |
fi | |
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" |
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
deployment: | |
production: | |
branch: master | |
commands: | |
- heroku maintenance:on --app app_name_here | |
- git push git@heroku.com:app_name_here.git $CIRCLE_SHA1:master | |
- heroku run rake db:migrate --app app_name_here | |
- heroku run rake setup_something --app app_name_here | |
- heroku run rake fs:rebuild --app app_name_here | |
- heroku restart --app app_name_here |
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
Image.all.each do |image| | |
begin | |
file = File.new("image.jpg", "w").binmode | |
open(image.image_url, "r") { |data| file.write data.read } | |
image.width, image.height = ::MiniMagick::Image.open(file)[:dimensions] | |
image.save | |
rescue | |
puts "Øv" | |
end | |
puts image.inspect |
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
# -*- encoding : utf-8 -*- | |
CarrierWave.configure do |config| | |
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['AWS_REGION'] | |
} | |
config.fog_directory = "#{ ENV['FOG_DIRECTORY'] }#{ Rails.env }" | |
config.fog_public = 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
//VIDEOS CONTROLLER// | |
def new | |
@video = Video.new | |
@uuid = (0..29).to_a.map { |x| rand(10) } | |
end | |
def create | |
@video = Video.new(params[:video]) | |
@video2 = Video.new(params[:video]) |
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 "rubygems" | |
require "ruby-audio" | |
require "fileutils" | |
require "rmagick" | |
# TODO: set these with command line options | |
# pixel width of final waveform image | |
Width = 1800 | |
# pixel height of final waveform image | |
Height = 280 |
NewerOlder