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 ActiveRecord | |
module Suppressor | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def suppress(&block) | |
SuppressorRegistry.suppressed[name] = true | |
yield | |
ensure | |
SuppressorRegistry.suppressed[name] = 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
class User < ActiveRecord::Base | |
# assocations omitted for simplicity | |
def follow user_to_follow | |
Relationship.create(follower: self, followed: user_to_follow) | |
end | |
end | |
class Relationship < ActiveRecord::Base | |
# assocations omitted for simplicity |
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
track_viewer_event = lambda {|viewers_count| | |
AnalyticsAdapter.new.track event: 'viewer_entered', | |
data: { event_slug: viewer.event.slug, | |
event_id: viewer.event.id, | |
viewer: viewer.id, | |
viewer_uuid: viewer.uuid, | |
online_viewers: viewers_count }, | |
ip_address: request.remote_ip, | |
user_agent: request.user_agent | |
} |
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
Signal.trap('USR2') do | |
pid = Process.pid | |
puts "[#{pid}] Received USR2 at #{Time.now}. Dumping threads:" | |
Thread.list.each do |t| | |
trace = t.backtrace.join("\n[#{pid}] ") | |
puts "[#{pid}] #{trace}" | |
puts "[#{pid}] ---" | |
end | |
puts "[#{pid}] -------------------" | |
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
timer = null | |
duration = moment.duration '00:00' | |
startCountdown = (startTime) -> | |
duration = moment.duration startTime | |
oneSecond = moment.duration(1, 'seconds') | |
timer = $interval -> | |
duration.subtract oneSecond | |
resetCountdown() if duration.asSeconds() == 0 | |
, 1000 |
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
$(".properties-table tr").each(function() { | |
console.log($(this).find('td').text().trim() + ": " + $(this).find('input').val()) | |
}); |
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
throttledHandleVideoPlayerMetadata = Utils.throttle(function(e) { | |
function t(e, t) { | |
return parseFloat(e[t].replace(/\x03/, "")) | |
} | |
if (e.metadata.error && (Debugging.log("Player Metadata Error"), Debugging.log(e.metadata.type), Debugging.log(e.metadata.error), "manifestRefreshError" === e.metadata.type && Actions.endBroadcast()), e.metadata.TIT3) { | |
var i = t(e.metadata, "TIT3"); | |
Actions.renderedNTP(i) | |
} | |
if (e.metadata.TKEY) { | |
var a = t(e.metadata, "TKEY"); |
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
# Symlink the ondeck database.yml to database.yml.example | |
# .ebextensions/database_yml.config | |
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/pre/01a_symlink_database_yml.sh": | |
mode: "000777" | |
content: | | |
#!/bin/bash | |
cd /var/app/ondeck/config | |
ln -sf database.sample.yml database.yml |
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 Rubber::Util.has_asset_pipeline? | |
# load 'deploy/assets' | |
_cset :asset_env, "RAILS_GROUPS=assets" | |
_cset :assets_prefix, "assets" | |
_cset :assets_role, [:app] | |
_cset :normalize_asset_timestamps, false | |
before 'deploy:finalize_update', 'deploy:assets:symlink' |