use std::io::buffered::BufferedReader;
use std::io::stdin;
use std::os;
use std::io::File;
fn lines(path: ~str) -> ~[~str] {
This file contains 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
public class Promise<T> { | |
private final AtomicReference<T> ref = new AtomicReference<T>(); | |
private final CountDownLatch latch = new CountDownLatch(1); | |
public final void deliver(T object) { | |
if (this.ref.compareAndSet(null, object)) { | |
latch.countDown(); | |
} | |
} |
This file contains 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
fun <T> Capture(block: () -> T): T { | |
try { | |
return block.invoke() | |
} catch (e: Exception) { | |
Sentry.captureException(e) | |
throw e | |
} | |
} | |
Capture { |
This file contains 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
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 |
This file contains 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
#!/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 |
This file contains 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
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 { | |
This file contains 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
Process: csgo_osx [50248] | |
Path: /Users/USER/Library/Application Support/Steam/*/csgo_osx | |
Identifier: csgo_osx | |
Version: ??? | |
Code Type: X86 (Native) | |
Parent Process: bash [50245] | |
Responsible: bash [354] | |
User ID: 501 | |
Date/Time: 2014-01-02 13:59:11.710 +0000 |
This file contains 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
package com.swrve.push_system; | |
import com.google.common.util.concurrent.RateLimiter; | |
import com.relayrides.pushy.apns.ApnsEnvironment; | |
import com.relayrides.pushy.apns.ApnsPushNotification; | |
import com.relayrides.pushy.apns.PushManager; | |
import java.security.KeyStore; | |
import java.util.Collection; | |
import scala.actors.threadpool.Arrays; |
This file contains 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
parts = [1982, 5, 29] | |
// => [1982, 5, 29] | |
// This is my birthday. | |
new Date(parts) | |
// => Sat May 29 1982 00:00:00 GMT+0100 (IST) | |
// Month is 1-based (5 = May) | |
new Date(parts[0], parts[1], parts[2]) | |
// => Tue Jun 29 1982 00:00:00 GMT+0100 (IST) |
This file contains 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
import time | |
import requests | |
import json | |
import base64 | |
from flask import Flask | |
from flask import jsonify | |
from flask import Response | |
consumer_key = 'CONSUMER KEY FOR YOUR APP' | |
consumer_secret = 'CONSUMER SECRET FOR YOUR APP' |