This file contains 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
def ago(date_or_time) | |
return nil unless date_or_time | |
date_or_time.to_time < Time.now ? "#{time_ago_in_words(date_or_time)} #{I18n.t('time_ago')}" : "#{time_ago_in_words(date_or_time)} #{I18n.t('time_from')}" | |
end |
This file contains 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
development: | |
adapter: postgresql | |
encoding: unicode | |
database: passion-dragon_development | |
min_messages: warning | |
test: | |
adapter: postgresql | |
encoding: unicode | |
database: passion-dragon_test |
This file contains 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
GPB.Controls.Stencil.Audio = function (stencil) { | |
var API = { constructor: GPB.Controls.Stencil.Audio } | |
API.maskTagName = 'div'; | |
API.findElements = function (doc) { | |
return doc.querySelectorAll('.audio-placeholder'); | |
} | |
API.fitMask = function (audioPlaceholder, audioMask) { |
This file contains 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 ApplicationHelper | |
def s3_upload_form_tag(bucket, subfolder = "uploads", presigned_post_options = {}, html_options = {}, &block) | |
key = [ | |
subfolder, | |
SecureRandom.urlsafe_base64, | |
'${filename}' ].reject(&:blank?).join('/') | |
s3 = AWS::S3.new | |
bucket = s3.buckets[bucket] |
This file contains 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
class GoodFollower | |
def self.connect(&block) | |
begin | |
temporarily_connect_to_follower | |
yield | |
ensure | |
restore_connection_to_leader | |
end | |
end |
This file contains 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
= form_tag material_rating_path(@material) do | |
.btn-group | |
= button_tag class: "btn btn-rating", name: "rating", value: -2 do | |
= image_tag "negative_two_rating.png" | |
span.badge.badge-important -- | |
= button_tag class: "btn btn-rating", name: "rating", value: -1 do | |
= image_tag "negative_one_rating.png" | |
span.badge.badge-warning - | |
= button_tag class: "btn btn-rating", name: "rating", value: 0 do | |
= image_tag "zero_rating.png" |
This file contains 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
addDate: '2011-05-31T20:15:20.000Z' | |
assetURI: http://concept.goorulearning.org/repository/ | |
batchId: | |
brokenStatus: 0 | |
category: Exam | |
codes: | |
contentId: 18807 | |
contentType: | |
createdOn: | |
creator: |
This file contains 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
#compdef rake | |
if [[ -f Rakefile ]]; then | |
local recent=$(ls -t .rake_tasks~ Rakefile **/*.rake | head -n 1) | |
if [[ $recent != .rake_tasks~ ]]; then | |
rake --tasks | cut -d ' ' -f 2 > .rake_tasks~ | |
fi | |
compadd $(cat .rake_tasks~) | |
fi |
This file contains 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
☁ gooru [master] tconsole -o all | |
Welcome to tconsole (v1.2.5). Type 'help' for help or 'exit' to quit. | |
Loading environment... | |
Environment loaded in 0.076461s. | |
Running tests... | |
Run options: --seed 15398 |
This file contains 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
class Follower | |
def self.connect(&block) | |
if Stage.production? | |
connect_to_follower(&block) | |
else | |
yield | |
end | |
end |