Skip to content

Instantly share code, notes, and snippets.

View marcomorain's full-sized avatar

Marc O'Morain marcomorain

View GitHub Profile
fun <T> Capture(block: () -> T): T {
try {
return block.invoke()
} catch (e: Exception) {
Sentry.captureException(e)
throw e
}
}
Capture {
package flipdish
import android.content.Context
import android.provider.Settings
import com.joshdholtz.sentry.Sentry
import java.util.Collections
import android.util.Log
import android.widget.Toast
import java.util.concurrent.atomic.AtomicReference
@marcomorain
marcomorain / flakey.py
Last active February 21, 2016 14:23
Find Flakey Tests
#!/usr/bin/env python
import requests
import os
import sys
import pprint
import re
from sets import Set
from collections import defaultdict, Counter
from urlparse import urlparse
@marcomorain
marcomorain / gist:30ae808f2849dd219ef7
Created March 23, 2015 11:52
CircleCI Postgres Finnish
machine:
environment:
PGDATA: /var/lib/postgresql/9.4/main
pre:
- sudo locale-gen fi_FI.UTF-8 # Install Finnish
# Re-create database in Finnish
- sudo -E -u postgres /usr/lib/postgresql/9.4/bin/pg_ctl stop
- sudo -E -u postgres rm -r $PGDATA
- sudo -E -u postgres /usr/lib/postgresql/9.4/bin/initdb --lc-collate fi_FI.UTF-8 --lc-ctype fi_FI.UTF-8
@marcomorain
marcomorain / My vim right now
Created December 9, 2014 12:22
My vim right now
N5RMA"Convert build parameters to a suitable form to be exported as bash.clj[+] clojure < utf-8[unix] < 18% : 30: 11
"46c/cenvironment variables."des.clj" 161L, 7057C^[OB^[OA^[OB^[OA
^47f [build-parameters]
^C^[:q ios-with-gemfiles > src/circle/backend/action/nodes.clj clojure
Type :quit<Enter> to exit Vim
Thread 0 Crashed:: MainThrd Dispatch queue: com.apple.main-thread
0 libtier0.dylib 0x0058a2f2 Plat_ExitProcess + 34
1 libtier0.dylib 0x005894f4 CStdMemAlloc::SetCRTAllocFailed(unsigned long) + 148
2 libtier0.dylib 0x00588fb8 CStdMemAlloc::Alloc(unsigned long) + 72
3 scaleformui.dylib 0x0c50aa1e CScaleformSysAlloc::Alloc(unsigned long, unsigned long) + 62
4 scaleformui.dylib 0x0c5dd8ea Scaleform::HeapMH::AllocEngineMH::allocDirect(unsigned long, unsigned long, bool*, Scaleform::HeapMH::PageInfoMH*) + 200
5 scaleformui.dylib 0x0c5ddf71 Scaleform::HeapMH::AllocEngineMH::Alloc(unsigned long, unsigned long, Scaleform::HeapMH::PageInfoMH*, bool) + 247
6 scaleformui.dylib 0x0c5ded87 Scaleform::MemoryHeapMH::Alloc(unsigned long, unsigned long, Scaleform::AllocInfo const*) + 69
7 scaleformui.dylib 0x0c5f1fb6 Scaleform::Render::ContextImpl::Context::Capture() + 454
8 scaleformui.dylib
package com.swrve.test_case;
public class Walker<ResultType, ValueType> {
public static void main(String[] args) {
}
public abstract class Builder<ResultType, ValueType> {
public abstract class StringVal {
public abstract String getString(ValueType theVal);
Internal Server Error
The server has either erred or is incapable of performing the requested operation.
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
rv = self.handle_exception(request, response, e)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
package com.swrve.babble;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import org.glassfish.jersey.uri.UriTemplate;
public class UrlTemplate {
@marcomorain
marcomorain / gist:8357744
Last active January 2, 2016 20:38
I tried to use Rust today....

Rust

My first idea: clone the comm commandline tool.

use std::io::buffered::BufferedReader;
use std::io::stdin;
use std::os;
use std::io::File;

fn lines(path: ~str) -> ~[~str] {