Skip to content

Instantly share code, notes, and snippets.

View killerswan's full-sized avatar

Kevin Cantú killerswan

View GitHub Profile
java -jar slave.jar -jnlpUrl https://wombat/computer/build0/slave-agent.jnlp
Exception in thread "main" java.io.IOException: Failed to validate a server certificate. If you are using a self-signed certificate, you can use the -noCertificateCheck option to bypass this check.
at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:322)
at hudson.remoting.Launcher.run(Launcher.java:218)
at hudson.remoting.Launcher.main(Launcher.java:192)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
@killerswan
killerswan / overloaded_functions.rs
Created June 11, 2014 17:26
Overloading Rust functions on tuples by abusing traits :D
enum AaBbEnum {
Aa,
Bb,
}
trait AaBb {
fn get_type(&self) -> AaBbEnum;
fn get_aa(self) -> (int, f64) { fail!(); }
fn get_bb(self) -> (f64) { fail!(); }
}
@killerswan
killerswan / gist:3552d816fb18c6e0b32a
Last active August 29, 2015 14:02
error: I don't know how to expand a syntax expression into _multiple_ statements: https://github.com/killerswan/ovid/tree/1515763bcb5335f5fc5924d09a8b1c7e3ad2c3f9
$ ./build.sh
CSVProvider.rs:145:23: 158:7 error: mismatched types: expected `@syntax::ast::Pat` but found `@syntax::codemap::Spanned<syntax::ast::Stmt_>` (expected struct syntax::ast::Pat but found struct syntax::codemap::Spanned)
CSVProvider.rs:145 return MacPat::new(quote_stmt!(cx, {
CSVProvider.rs:146 struct MyCSV {
CSVProvider.rs:147 data: Vec<(String)>,
CSVProvider.rs:148 }
CSVProvider.rs:149
CSVProvider.rs:150 impl MyCSV {
...
error: aborting due to previous error
@killerswan
killerswan / gist:b4e6d5840c46942bd3be
Created June 30, 2014 09:28
From ovid 84cec0e, trying to substitute $name instead of hard-coding it...
ovid $ git diff
diff --git a/CSVProvider.rs b/CSVProvider.rs
index ee8c7ba..b75d0ba 100644
--- a/CSVProvider.rs
+++ b/CSVProvider.rs
@@ -158,7 +158,7 @@ fn provide_csv_given_labels(cx: &mut ExtCtxt, sp: Span, tts: &[TokenT
fn define_my_csv(cx0: &mut ExtCtxt) -> Option<Gc<syntax::ast::Item>> {
let item1: Option<Gc<syntax::ast::Item>> = quote_item!(cx0,
- pub struct MyCSV {
@killerswan
killerswan / gist:87b9482eca5d09c82619
Last active August 29, 2015 14:04
Why is this extra let binding necessary? See line 13 below. If you remove it, there's an error. (And the source code: https://github.com/killerswan/ovid/blob/b197f03f4b670e25c420751ec3358ead2d42059a/CSVProvider.rs#L139)
ovid $ git ll -1 --oneline
* b197f03 (HEAD, master) cleanup
ovid $
ovid $ git diff
diff --git a/CSVProvider.rs b/CSVProvider.rs
index 2b24cd2..2181c0b 100644
--- a/CSVProvider.rs
+++ b/CSVProvider.rs
@@ -205,8 +205,7 @@ fn provide_csv_given_labels(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Bo
@killerswan
killerswan / gist:337f9f84a2e788a3c2a5
Created July 26, 2014 15:19
Why should an uppercase variable (defined by macro expansion) cause an out-of-bounds ICE? Although this was on rustc 0.11.0-pre (b47f2226a25654c5b781d27a91f2fa5274b3a347 2014-06-28 14:31:37 +0000), rather than current master rustc.
ovid $ git ll -1 --oneline
* 220b83a (HEAD, master) now naming the column [singular]
ovid $
ovid $ git diff
diff --git a/CSVSample.rs b/CSVSample.rs
index 9e57175..4e279c4 100644
--- a/CSVSample.rs
+++ b/CSVSample.rs
@@ -3,7 +3,6 @@
@killerswan
killerswan / gist:98486086d32a3fad001a
Created July 26, 2014 16:29
An error on mismatched visibility when (perhaps) misusing `quote_item!`
ovid $ git ll -1 --oneline
* b197f03 (HEAD, master) cleanup
ovid $
ovid $ git diff
ovid $
ovid $ ./build.sh
provide_csv_given_labels: name: MyCSV
provide_csv_given_labels: path: ./sample1.txt
provide_csv_given_labels: labels: Verse
Parsing given labels...
@killerswan
killerswan / gist:ce432525ecc1ce46b977
Created August 26, 2014 04:12
RoboCopy usage message
C:\Users\builduk>robocopy /?
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Tue Aug 26 05:09:59 2014
Usage :: ROBOCOPY source destination [file [file]...] [options]
struct Foo {
x: int
}
struct Bar<'a> {
foo: &'a Foo
}
trait Baz {
fn baz();
@killerswan
killerswan / gist:62e1b2807ff60b30f213
Created October 17, 2014 02:42
msi_only is safe to remove, I think...
C:\code\vSentry\tests\scripts\job_scheduling\HCKwww>grep -iHrn msi_only *
batchscheduler.py:133: def copy_files(self, wait=False, msi_only=False):
batchscheduler.py:149: if msi_only:
batchscheduler.py:156: def install(self, wait=False, msi_only=False):
batchscheduler.py:161: res = self.copy_files(wait, msi_only)
batchscheduler.py:232: def try_install(self, wait=False, msi_only=False):
batchscheduler.py:234: return self.try_action(lambda: self.install(wait=wait, msi_only=msi_only), Binary file batchscheduler.pyc matches
C:\code\vSentry\tests\scripts\job_scheduling\HCKwww>grep -iHrn "copy_files(" *
batchscheduler.py:133: def copy_files(self, wait=False, msi_only=False):