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 xhtmlized.local; | |
| root /Users/zmack/work/xhtmlized/current; | |
| location / { | |
| ssi on; | |
| } | |
| location /customer/ { | |
| rewrite /customer/(.*)$ /$1 break; |
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 'psych' | |
| require 'net/http' | |
| require 'meme' # Install meme_generator | |
| module Campfire | |
| class API | |
| attr_reader :uri, :token, :pass |
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 | |
| require 'net/http' | |
| def get_server(site) | |
| Net::HTTP.start(site, 80) do |http| | |
| response = http.head('/') | |
| response['server'] | |
| end | |
| rescue Exception => e |
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
| true | |
| true | |
| true | |
| true | |
| true | |
| user system total real | |
| Foo 0.990000 0.000000 0.990000 ( 0.989358) | |
| Bar 0.720000 0.000000 0.720000 ( 0.713166) | |
| Baz 0.320000 0.000000 0.320000 ( 0.323896) | |
| Fle 0.330000 0.000000 0.330000 ( 0.326319) |
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
| mysql> create table mars( id int unsigned, bar enum('foo','bar','baz')) | |
| mysql> insert into mars values (1,'foo'), (2, 'bar'), (3, 'baz'); | |
| mysql> select * from mars; | |
| +------+------+ | |
| | id | bar | | |
| +------+------+ | |
| | 1 | foo | | |
| | 2 | bar | |
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
| (print [1 2 3 4 5]) | |
| (seq {:a 1 :b 2}) | |
| ((fn foo [x] (when (> x 0) (conj (foo (dec x)) x))) 5) | |
| (seq (reverse (range 1 6))) | |
| (-> (range 5) reverse filter `#(% > 1)) | |
| (-> [2 5 4 1 3 6] reverse rest sort last) |
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
| Index: net/instaweb/rewriter/rewrite_context.cc | |
| =================================================================== | |
| --- net/instaweb/rewriter/rewrite_context.cc (revision 4146) | |
| +++ net/instaweb/rewriter/rewrite_context.cc (working copy) | |
| @@ -962,7 +962,7 @@ | |
| handler_->Message( | |
| kInfo, "Deadline exceeded for rewrite of resource %s with %s.", | |
| input->url().c_str(), rewrite_context_->id()); | |
| - FetchFallbackDoneImpl(input->contents(), input->response_headers()); | |
| + FetchFallbackDoneImpl(input->contents(), input->response_headers(), true); |
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 std::io::fs; | |
| use std::io::fs::PathExtensions; | |
| use std::io::net::pipe::UnixListener; | |
| use std::io::{Acceptor,Listener}; | |
| use std::string::String; | |
| fn main() { | |
| let socket = Path::new("server.sock"); | |
| let mut buffer = String::with_capacity(1024); |
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
| #[deriving(Show,Clone)] | |
| enum DiskStruct { | |
| File(String), | |
| Dir(String) | |
| } | |
| impl DiskStruct { | |
| fn new(path: &str) -> DiskStruct { | |
| match path.slice_from(path.len()-1) { | |
| "/" => DiskStruct::Dir(path.to_string()), |
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
| impl Operation for Bar { | |
| fn add(&self, other: int) { | |
| } | |
| } | |
| impl OtherOperation for Bar { | |
| fn zero(&self) -> uint { | |
| 0 | |
| } |