Skip to content

Instantly share code, notes, and snippets.

View ryansroberts's full-sized avatar

Ryan Roberts ryansroberts

View GitHub Profile
Elaborate lives of each have been written by devotees, and there is one thing common to all three -- an omission. We hear nothing of Christ between the ages of twelve and thirty. Mohammed disappeared into a cave. Buddha left his palace, and went for a long while into the desert.
Each of them, perfectly silent up to the time of the disappearance, came back and immediately began to preach a new law.
This is so curious that it leaves us to inquire whether the histories of other great teachers contradict or confirm
Moses led a quiet life until his slaying of the Egyptian. He then flees into the land of Midian, and we hear nothing of what he did there, yet immediately on his return he turns the whole place upside down. Later on, too, he absents himself on Mount Sinai for a few days, and comes back with the Tables of the Law in his hand.
St. Paul (again), after his adventure on the road to Damascus, goes into the desert of Arabia for many years, and on his return overturns the Roman Empire. Even in the legends
#+BEGIN_SRC plantuml :file actors.png
cloud facebook
cloud google
node [Prescience API]
agent mobiledevice
agent router
prescienceapi -- facebook
prescienceapi -- google
mobiledevice -- facebook
~/c/lolba ❯❯❯ dotnet build --native
Compiling olba for
NXCore,Version=v5.0
ompilation succeeded.
0 Warning(s)
0 Error(s)
Time elapsed 00:00:05.8359092
Input Assembly: /Users/ryanroberts/code/lolba/bin/Debug/dnxcore50/lolba.dll
curl -H "Accept: text/csv" https://query.wikidata.org/bigdata/namespace/wdq/sparql\?query\=SELECT%20DISTINCT%20%3Fcity%20%3FcityLabel%20%3Fmayor%20%3FmayorLabel%20%0AWHERE%20%0A%7B%0A%09%3Fcity%20wdt%3AP31%2Fwdt%3AP279\*%20wd%3AQ515%20.%20%20%23%20find%20instances%20of%20subclasses%20of%20city%0A%09%3Fcity%20p%3AP6%20%3Fstatement%20.%20%20%20%20%20%20%20%20%20%20%20%20%23%20with%20a%20P6%20\(head%20of%20goverment\)%20statement%0A%09%3Fstatement%20ps%3AP6%20%3Fmayor%20.%20%20%20%20%20%20%20%20%20%20%20%23%20...%20that%20has%20the%20value%20%3Fmayor%0A%09%3Fmayor%20wdt%3AP21%20wd%3AQ6581072%20.%20%20%20%20%20%20%20%23%20...%20where%20the%20%3Fmayor%20has%20P21%20\(sex%20or%20gender\)%20female%0A%09FILTER%20NOT%20EXISTS%20%7B%20%3Fstatement%20pq%3AP582%20%3Fx%20%7D%20%20%23%20...%20but%20the%20statement%20has%20no%20P582%20\(end%20date\)%20qualifier%0A%09%20%0A%09%23%20Now%20select%20the%20population%20value%20of%20the%20%3Fcity%0A%09%23%20\(wdt%3A%20properties%20use%20only%20statements%20of%20%22preferred%22%2
public class AsyncStreamCopier
{
public event EventHandler Completed;
private readonly Stream input;
private readonly Stream output;
private byte[] buffer = new byte[4096];
public AsyncStreamCopier(Stream input, Stream output)
//Root object, builds a webapi delegating handler
public static void BootstrapCache(this HttpConfiguration configuration,
Cache cache,
IEnumerable<CacheHandler.Rule> rules,
RewriteResponse rewriteResponse, //Delegates to clean up Func<Func< eye searing signatures
RewriteRequest rewriteRequest,
MonitorCacheOperation monitor,
Func<string,string> secrets)
@ryansroberts
ryansroberts / gist:7452037
Created November 13, 2013 16:33
Fuctional
var parser =
UntilOpenQuote
(RecChar('h')
(RecChar('t')
(RecChar('t')
(RecChar('p')
(RecChar(':')
(RecChar('/')
(RecChar('/')
(UntilCloseQuote
public class Mutations
{
readonly BrowserSession session;
public Mutations(BrowserSession session)
{
this.session = session;
}
public Action ClickOnAnElement(string css, int ms = 200)
@ryansroberts
ryansroberts / gist:6536853
Created September 12, 2013 12:57
Fuck you webdriver
private void AppDomain_UnhandledException(Object sender, UnhandledExceptionEventArgs e){
this.error = ((Exception)e.ExceptionObject).Message;
if(this.thread.IsAlive){
this.thread.Abort();
this.timerhotkey.Stop();
Thread.CurrentThread.Join();
}
}
public class ReorderSupportingResourcePart : Handles<Hypermedia.ReorderSupportingResourcePart>
{
static Register route = () => "supportingresources/{supportingresourceid}/reorderresourcepart/{partid}";
readonly IDocumentStore store;
public ReorderSupportingResourcePart(IDocumentStore store) { this.store = store; }
public HttpResponseMessage Post(string supportingresourceid, int partid, Hypermedia.ReorderSupportingResourcePart input)
{