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
class ServiceClient(val userAgent: String, val rateLimit: Float = 1.0f) { | |
// ref https://github.com/kittinunf/Fuel | |
private val fuelManager = FuelManager() | |
private var previousDispatchTime = Instant.now() | |
init { | |
fuelManager.basePath = "https://my-service.com" | |
fuelManager.baseHeaders = mapOf("User-Agent" to userAgent) | |
fuelManager.addRequestInterceptor { |
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
➜ oxi master ✗ cargo build | |
Compiling oxi v0.1.0 (file:///Users/xpm/Dropbox/Code/oxi) | |
error[E0530]: match bindings cannot shadow statics | |
--> src/main.rs:58:10 | |
| | |
20 | use new::{new, new_command, NEW_COMMAND_NAME}; | |
| ---------------- a static `NEW_COMMAND_NAME` is imported here | |
... | |
58 | Some(NEW_COMMAND_NAME) => { new(&context); } | |
| ^^^^^^^^^^^^^^^^ cannot be named the same as a static |
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
error: borrowed value does not live long enough | |
--> src\main.rs:80:29 | |
| | |
80 | current_dir().unwrap().as_path() | |
| ^^^^^^^^^^^^^^^^^^^^^^ temporary value created here | |
81 | }; | |
| - temporary value only lives until here | |
... | |
92 | } | |
| - temporary value needs to live until here |
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
// pulled from http://wiki.unity3d.com/index.php/SimpleJSON | |
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member | |
//#define USE_SharpZipLib | |
#if !UNITY_WEBPLAYER | |
#define USE_FileIO | |
#endif | |
/* * * * * | |
* A simple JSON Parser / builder |
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 clap::{Arg, ArgMatches, App, SubCommand}; | |
pub fn parse_args<'a>() -> ArgMatches<'a, 'a> { | |
let matches = App::new("lod") | |
.version(&crate_version!()[..]) | |
.author("Christopher R. Miller <[email protected]") | |
.about("LOD archive utility.") | |
.subcommand_required(true) | |
.versionless_subcommands(true) | |
.unified_help_message(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
extern crate docopt; | |
extern crate rustc_serialize; | |
use self::docopt::Docopt; | |
const USAGE: &'static str = " | |
LOD archive utility. | |
Usage: | |
lod -t [-v -f FILE] |
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
C:\Users\Chris>cl | |
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x86 | |
Copyright (C) Microsoft Corporation. All rights reserved. | |
usage: cl [ option... ] filename... [ /link linkoption... ] | |
C:\Users\Chris>cd Code\speculator | |
C:\Users\Chris\Code\speculator>cargo build | |
Compiling hoedown v3.0.2 |
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
defmodule Life do | |
def start do | |
spawn(fn -> listen() end) | |
end | |
defp listen() do | |
receive do | |
{:add, url} -> | |
loop(url) | |
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
require 'net/http' | |
require 'net/https' | |
require 'json' | |
require 'pry' | |
$client_id = 'lol' | |
$client_secret = 'its a freakin secret man!' | |
user = 'DeadpoolSupplier' | |
page = 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
Interval<double>.Test(0.5) | |
.IfOn("[0,0.3)", () => /* ... */ ) | |
.IfOn("[0.3,0.7)", () => /* ... */) | |
.IfOn("[0.7,1]", () => /* ... */) | |
.UnlessOn("[-1,0)", () => /* ... */) | |
.Else(() => /* ... */); |