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 @PollingQueue | |
constructor: (opts) -> | |
opts || (opts = {}) | |
@queue = {} | |
@frequency = opts.frequency || 3000 # 3 seconds | |
@interval = undefined | |
add: (url, options = {}) -> | |
return unless url |
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 @StatusPollingQueue | |
constructor: () -> | |
@queue = [] | |
@frequency = 3 * 1000 # 3 seconds | |
@interval = undefined | |
@failureLimit = 50 | |
add: (url, options = {}) -> | |
return unless url |
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 @PollingQueue | |
constructor: () -> | |
@queue = [] | |
@frequency = 3000 # 3 seconds | |
@interval = undefined | |
@failureLimit = 50 | |
add: (url, options = {}) -> | |
return unless url |
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
bucket = 'intergi-phoenix' | |
files = S3Util.storage.directories.get(bucket, prefix: '12917/videos/').files | |
files.each do |file| | |
path = file.key | |
video_id = path[/videos\/(\d+)\//, 1].to_i | |
if video_id < 3270839 | |
puts "skip #{video_id}" | |
next |
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
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/" | |
} | |
export BRANCH_INFO='$(parse_git_branch)' | |
export CURRENT_BRANCH='$BRANCH_INFO' | |
export PS1="\[\033[00;32m\]\u\[\033[01m\]@\[\033[00;36m\]\h\[\033[01m\] \! \[\033[00;35m\]\w\[\033[00m\]\[\033[00m\] ($BRANCH_INFO)\$ " |
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
use CGI; | |
my $q = CGI->new; | |
$to_host = 'https://www1.udel.edu'; | |
$url = $ENV{'REDIRECT_URL'}; | |
$url =~ s/^https?:\/\/[^\/]+//g; | |
print $q->redirect($to_host . $url); |
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
(byebug) rule['Transition']['Date'].is_a?(Time) ? time.utc.iso8601 : Time.parse(time).utc.iso8601 | |
TypeError Exception: can't convert Nokogiri::XML::Builder::NodeBuilder to String (Nokogiri::XML::Builder::NodeBuilder#to_str gives Nokogiri::XML::Builder::NodeBuilder) | |
nil | |
(byebug) time | |
#<Nokogiri::XML::Builder::NodeBuilder:0x007fc0f1de5828 @node=#<Nokogiri::XML::Element:0x3fe078ef2ca0 name="time">, @doc_builder=#<Nokogiri::XML::Builder:0x007fc0f1dd3538 @doc=#<Nokogiri::XML::Document:0x3fe078ee977c name="document" children=[#<Nokogiri::XML::Element:0x3fe078ee9268 name="LifecycleConfiguration" children=[#<Nokogiri::XML::Element:0x3fe078ee8afc name="Rule" children=[#<Nokogiri::XML::Element:0x3fe078ee828c name="ID" children=[#<Nokogiri::XML::Text:0x3fe078ef9fc8 "Gaclierizer:1">]>, #<Nokogiri::XML::Element:0x3fe078ef1b34 name="Prefix" children=[#<Nokogiri::XML::Text:0x3fe078ef9b18 "1/videos">]>, #<Nokogiri::XML::Element:0x3fe078ef138c name="Status" children=[#<Nokogiri::XML::Text:0x3fe078ef9654 "Enabled">]>, #<Nokogi |
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 ResqueWeb | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
if env['PATH_INFO'].include? '/resque' | |
resque_web = Rack::Builder.new { | |
map "/resque" do |
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 FLVActivities | |
extend Activities | |
activities :generate_flv, :upload_flv | |
... | |
end | |
class ScreenshotActivies | |
extend Activities |
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
AdServer::Application.routes.draw do | |
# The priority is based upon order of creation: first created -> highest priority. | |
# See how all your routes lay out with "rake routes". | |
# You can have the root of your site routed with "root" | |
get '/wrapper.swf' => 'application#wrapper' | |
get '/vast.xml' => 'application#vast' |
NewerOlder