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
| #!/usr/bin/env ruby | |
| # Given a lock name and a trailing command, this program | |
| # ensures there's only one instance of a given program running | |
| # at a time, by blocking on a ZooKeeper lock. | |
| # | |
| # Usage: | |
| # ./ensure_locked.rb [lock name] bundle exec rake resque:scheduler | |
| # |
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/element-breakoutrow.php b/element-breakoutrow.php | |
| index 8382135..4b90f24 100644 | |
| --- a/element-breakoutrow.php | |
| +++ b/element-breakoutrow.php | |
| @@ -28,10 +28,10 @@ | |
| 'paged'=>$paged, // Basic pagination stuff. | |
| ); | |
| - query_posts($args); | |
| + $footer_post_query = new WP_Query($args); |
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
| <?php | |
| class MediaPistonVerifier { | |
| private $endpoint_path; | |
| private $query_params; | |
| private $api_private_key; | |
| /* | |
| * Constructor: | |
| * | |
| * @param endpoint_path - the path that your notification script is |
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
| u = ->(m) do | |
| y = ->(*a, &b) { y = ->(*a) { b.(*a, &y) } } | |
| r = ->(n, f) do | |
| i, g = f.() | |
| i <= n ? [i] + r.(n, g) : [] | |
| end | |
| r.(m, y.() { |i, j, &b| -> { [j, b.(j, i + j)] } }.(1, 1)) | |
| 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
| #header { | |
| display: block; | |
| /* change to w/h of image */ | |
| width: 600px; | |
| height: 400px; | |
| /* set the background of the <h1> tag to the header image */ | |
| background: transparent url(/path/to/image.png) no-repeat; | |
| /* indent all plain text 99999 pixels off screen */ |
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 Resque | |
| # Provides a Failover to MySQL. | |
| module Failover | |
| def self.extended(base) | |
| base.class_eval do | |
| class << self | |
| alias_method_chain :enqueue, :active_record_failover | |
| alias_method_chain :enqueue_at, :active_record_failover | |
| end | |
| 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
| 1) | |
| 'Typhoeus::Response headers when the headers_hash is stubbed returns a properly formatted string built from the headers_hash, code, status_message and http_version' FAILED | |
| expected collection contained: ["\r", "Connection: keep-alive\r", "Content-Length: 0\r", "Content-Type: text/plain\r", "Server: thin 1.2.11 codename Bat-Shit Crazy\r", "Set-Cookie: bar\r", "Set-Cookie: foo\r", "X-Frame-Options: sameorigin\r", "X-Xss-Protection: 1; mode=block\r"] | |
| actual collection contained: ["\r", "Connection: keep-alive\r", "Content-Length: 0\r", "Content-Type: text/plain\r", "Server: thin 1.2.11 codename Bat-Shit Crazy\r", "Set-Cookie: bar\r", "Set-Cookie: foo\r", "X-Frame-Options: sameorigin\r", "X-XSS-Protection: 1; mode=block\r"] | |
| the missing elements were: ["X-Xss-Protection: 1; mode=block\r"] | |
| the extra elements were: ["X-XSS-Protection: 1; mode=block\r"] |
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
| 100.times do | |
| Thread.new do | |
| array = [] | |
| while true | |
| array << ("hahahaha" * 100000000000) | |
| if rand < 0.10 | |
| sleep(5) # randomly get a 5 second break from all this | |
| end | |
| 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
| module A | |
| def self.foo | |
| puts "yes" | |
| end | |
| end | |
| module B | |
| def foo | |
| puts "no" | |
| end |