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
diff --git a/lib/blather/client/client.rb b/lib/blather/client/client.rb | |
index 6c7fe4e..9e8350b 100644 | |
--- a/lib/blather/client/client.rb | |
+++ b/lib/blather/client/client.rb | |
@@ -184,11 +184,7 @@ module Blather | |
# @private | |
def receive_data(stanza) | |
- if handler_queue | |
- handler_queue << stanza |
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
def music_on_hold | |
output = play! "/path/to/music.wav", :repeat_times => 0 | |
hid = call.on_joined do | |
output.stop! if output.executing? | |
end | |
begin | |
yield.tap do | |
output.stop! if output.executing? |
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 'formula' | |
class Iksemel < Formula | |
homepage 'http://code.google.com/p/iksemel/' | |
url 'https://iksemel.googlecode.com/files/iksemel-1.4.tar.gz' | |
version '1.4' | |
depends_on 'gnutls' | |
def install |
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 "uri" | |
require "yajl/http_stream" | |
require "terminal-notifier" | |
require "celluloid" | |
class Stream | |
include Celluloid | |
def initialize(room, token) | |
@room = room |
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
# http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html | |
# Write a program that prints the numbers from 1 to 100. | |
# But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". | |
# For numbers which are multiples of both three and five print "FizzBuzz". | |
(1..100).each do |i| | |
res = if i % 3 == 0 && i % 5 == 0 | |
"FizzBuzz" |
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
$LOAD_PATH.unshift(File.dirname(__FILE__)) | |
%w(cgi socket routing/helpers routing/config routing/romeo routing/inbound routing/token).each { |lib| require lib } | |
module Foo | |
def self.test | |
puts "test" | |
end | |
end | |
Foo.test |
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
!!! | |
%html{:xmlns => "http://www.w3.org/1999/xhtml"} | |
%head | |
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ | |
%title #{@title}/ | |
%link{:href => "css/style.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/ | |
%link{:href => "css/contentlayout.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/ | |
%link{:href => "css/voice.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/ | |
%link{:href => "css/home.css", :rel => "stylesheet", :type => "text/css"}/ | |
%script{:src => "js/application.js", :type => "text/javascript"}/ |
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
!!! | |
%html{:xmlns => "http://www.w3.org/1999/xhtml"} | |
%head | |
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ | |
%title #{@title}/ | |
%link{:href => "css/style.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/ | |
%link{:href => "css/contentlayout.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/ | |
%link{:href => "css/voice.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/ | |
%link{:href => "css/home.css", :rel => "stylesheet", :type => "text/css"}/ | |
%script{:src => "js/application.js", :type => "text/javascript"}/ |
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
$("#edit_topics_link").text(<%= (@video.topics.count == 0) ? 'Add descriptive topics so people can find your song!' : 'Edit Topics' %>); |
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
def self.get_breaking_news(min) | |
doc = Hpricot.XML open("http://bensbargains.net/rss.xml/") | |
cutoff_time = Time.now - 60 * min | |
(doc/"item").map do |item| | |
profit_margin = (temp_deal.cost_retail.nil? || temp_deal.cost.nil?) ? nil : temp_deal.cost_retail - temp_deal.cost | |
Deal.new :name => (item/"title").inner_html, :description => (item/"description").inner_text + (item/"link").inner_html, :guid => (item/"guid").inner_html, :cost => get_price(temp_deal.name), :cost_retail => get_price_retail(temp_deal.description), :profit_margin => profit_margin, :source => "bensbargains" | |
end | |
end |
NewerOlder