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
| struct SomethingOpts { | |
| inverse: bool | |
| } | |
| trait SomethingArg { | |
| fn arg(&self) -> int; | |
| fn opts(&self) -> SomethingOpts; | |
| } | |
| impl SomethingArg for int { |
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
| extern crate serialize; | |
| use serialize::json; | |
| use serialize::json::ToJson; | |
| pub struct Connection; | |
| pub struct Table; | |
| pub struct Func; | |
| pub trait Runnable: ToJson { |
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
| [14] pry(main)> FooBarBaz | |
| NameError: uninitialized constant FooBarBaz |
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
| #![crate_type="lib"] | |
| trait Times { | |
| fn times(&self, f: |uint| -> ()); | |
| } | |
| impl Times for uint { | |
| fn times(&self, f: |uint| -> ()) { | |
| for i in range(0, *self) { | |
| f(i); |
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
| macro_rules! json_obj( | |
| ({ $($key:expr : $value:expr),* }) => ({ | |
| use serialize::json::ToJson; | |
| let mut _temp = ::collections::treemap::TreeMap::new(); | |
| $(_temp.insert($key.to_owned(), $value.to_json());)* | |
| ::serialize::json::Object(~_temp) | |
| }); | |
| ) | |
| fn foo() { |
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
| [ | |
| { | |
| "name": "University of Screw You", | |
| "tuition": 100000 | |
| }, | |
| { | |
| "name": "Go To Hell College", | |
| "tuition": 50 | |
| } | |
| ] |
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
| source 'https://rubygems.org/' | |
| gem 'sidetiq', '0.5.0' |
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 'bencode' | |
| require 'edn' | |
| require 'socket' | |
| if ARGV.length < 3 | |
| puts "usage: #{$0} <source-port> <dest-host> <dest-port>" | |
| exit | |
| 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
| ; <<>> DiG 9.8.3-P1 <<>> @4.2.2.2 fb.me | |
| ; (1 server found) | |
| ;; global options: +cmd | |
| ;; Got answer: | |
| ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 34716 | |
| ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 | |
| ;; QUESTION SECTION: | |
| ;fb.me. IN A |
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
| $ node foo.js | |
| events.js:72 | |
| throw er; // Unhandled 'error' event | |
| ^ | |
| Error: This socket has been ended by the other party | |
| at Socket.writeAfterFIN [as write] (net.js:276:12) | |
| at Socket.Writable.end (_stream_writable.js:335:10) | |
| at Socket.end (net.js:397:31) | |
| at Socket.<anonymous> (/Users/tom/foo.js:9:16) |