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
| $stack, $draws = [], {} | |
| def method_missing *args | |
| return if args[0][/^to_/] | |
| $stack << args.map { |a| a or $stack.pop } | |
| $draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
| end | |
| class Array | |
| def +@ |
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
| server { | |
| listen 80; | |
| server_name lucid32.dev; | |
| access_log /var/log/nginx/localhost.access.log; | |
| ## Default location | |
| location / { | |
| root /vagrant/yourprojectname; | |
| index index.php; | |
| } |
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
| ] wc -l domains.txt | |
| 783 domains.txt | |
| ] time go run domain_lookup_parallel.go | |
| real 0m5.743s | |
| user 0m0.359s | |
| sys 0m0.355s | |
| ] time go run domain_lookup_sequential.go |
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
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| // Suggestions from golang-nuts | |
| // http://play.golang.org/p/Ctg3_AQisl |
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
| after_fork do |server, worker| | |
| log_path = Rails.root.join('log',"#{Rails.env}.#{worker.nr}.log") | |
| new_logger = Logger.new(log_path) | |
| new_logger.level = Logger::INFO | |
| Rails.logger.flush | |
| Rails.logger.close | |
| Rails.logger = Rails.application.config.logger = ActiveSupport::TaggedLogging.new(new_logger) |
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
| // Todoapp using Localstorage | |
| /*global window */ | |
| /*global document */ | |
| (function () { | |
| "use strict"; | |
| window.todoApp = { | |
| addTodoBtn: document.getElementById("addTodo"), |
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 | |
| # | |
| # Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0333) | |
| # | |
| # ## Advisory | |
| # | |
| # https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/1h2DR63ViGo | |
| # | |
| # ## Caveats | |
| # |
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 SimpleStateMachine | |
| extend ActiveSupport::Concern | |
| # instance methods | |
| included do | |
| def current_step | |
| # model that includes this module must have a field called 'current_step' | |
| super || steps.first | |
| 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
| #!/usr/bin/env ruby | |
| # | |
| # Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0333) | |
| # | |
| # ## Advisory | |
| # | |
| # https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/1h2DR63ViGo | |
| # | |
| # ## Caveats | |
| # |