Skip to content

Instantly share code, notes, and snippets.

View mysteriouspants's full-sized avatar
:shipit:
Help! I'm trapped in a fixed-width str

Christopher R. Miller mysteriouspants

:shipit:
Help! I'm trapped in a fixed-width str
View GitHub Profile
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 {
➜ 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
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
// 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
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 <mysteriouspants@outlook.com")
.about("LOD archive utility.")
.subcommand_required(true)
.versionless_subcommands(true)
.unified_help_message(true)
extern crate docopt;
extern crate rustc_serialize;
use self::docopt::Docopt;
const USAGE: &'static str = "
LOD archive utility.
Usage:
lod -t [-v -f FILE]
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
defmodule Life do
def start do
spawn(fn -> listen() end)
end
defp listen() do
receive do
{:add, url} ->
loop(url)
end
require 'net/http'
require 'net/https'
require 'json'
require 'pry'
$client_id = 'lol'
$client_secret = 'its a freakin secret man!'
user = 'DeadpoolSupplier'
page = 0
Interval<double>.Test(0.5)
.IfOn("[0,0.3)", () => /* ... */ )
.IfOn("[0.3,0.7)", () => /* ... */)
.IfOn("[0.7,1]", () => /* ... */)
.UnlessOn("[-1,0)", () => /* ... */)
.Else(() => /* ... */);