<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
| require 'net/http' | |
| require 'uri' | |
| require 'time' | |
| class Time | |
| def self.gcalschema(tzid) # We may not be handling Time Zones in the best way... | |
| tzid =~ /(\d\d\d\d)(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)Z/ ? # yyyymmddThhmmss | |
| # Strange, sometimes it's 4 hours ahead, sometimes 4 hours behind. Need to figure out the timezone piece of ical. | |
| # Time.xmlschema("#{$1}-#{$2}-#{$3}T#{$4}:#{$5}:#{$6}") - 4*60*60 : | |
| Time.xmlschema("#{$1}-#{$2}-#{$3}T#{$4}:#{$5}:#{$6}") : |
| user sax staff; | |
| worker_processes 1; | |
| daemon off; | |
| error_log /var/log/nginx/error.log; | |
| #error_log logs/error.log notice; | |
| #error_log logs/error.log info; | |
| #pid logs/nginx.pid; | |
| pid /var/run/nginx.pid; |
| var http = require("http"), | |
| url = require("url"), | |
| path = require("path"), | |
| fs = require("fs") | |
| port = process.argv[2] || 8888; | |
| http.createServer(function(request, response) { | |
| var uri = url.parse(request.url).pathname | |
| , filename = path.join(process.cwd(), uri); |
| # WAIT! Do consider that `wait` may not be needed. This article describes | |
| # that reasoning. Please read it and make informed decisions. | |
| # https://www.varvet.com/blog/why-wait_until-was-removed-from-capybara/ | |
| # Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations? | |
| describe 'Modal' do | |
| should 'display login errors' do | |
| visit root_path |
| source "http://rubygems.org" | |
| gem 'sprockets', :git => 'git://github.com/sstephenson/sprockets.git' | |
| gem 'coffee-script' | |
| gem 'sass' | |
| gem 'rack-test' | |
| gem 'sinatra' |
| # This is Neocities' Rainbows! config file. We are using this in production to run all our web apps. | |
| # It works really well for us and has been heavily load tested, so I wanted to share it with the community. | |
| # | |
| # In my opinion, this is the best way to deploy a ruby web application. Unlike EventMachine based solutions, | |
| # it uses real ruby threads, which allows it to take advantage of the internal non-blocking IO pattern | |
| # in MRI. | |
| # | |
| # Contrary to popular belief, MRI doesn't block execution to wait on IO when you are using threads, even | |
| # with the GIL. The requests are done concurrently for anything that is based on the IO class. This | |
| # includes things like Net::HTTP and even `system commands`. Grep the MRI Ruby source code for |
| #!/usr/bin/ruby1.9.1 -Kw | |
| # -*- coding: utf-8 -*- | |
| class Edge | |
| attr_accessor :src, :dst, :length | |
| def initialize(src, dst, length = 1) | |
| @src = src | |
| @dst = dst | |
| @length = length |
| import SimpleHTTPServer | |
| class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
| def send_head(self): | |
| """Common code for GET and HEAD commands. | |
| This sends the response code and MIME headers. | |
| Return value is either a file object (which has to be copied | |
| to the outputfile by the caller unless the command was HEAD, | |
| and must be closed by the caller under all circumstances), or |
| # A queue that you can pass to IO.select. | |
| # | |
| # NOT THREAD SAFE: Only one thread should write; only one thread should read. | |
| # | |
| # Purpose: | |
| # Allow easy integration of data-producing threads into event loops. The | |
| # queue will be readable from select's perspective as long as there are | |
| # objects in the queue. | |
| # | |
| # Implementation: |