Skip to content

Instantly share code, notes, and snippets.

@dt
dt / gist:1cc0151bb3978eae1d25
Created October 31, 2014 05:32
10/31 ads build
[05:29] ~/code/fs/2 $ rm -rf .pants.d .local_artifact_cache/[^I]*
[05:29] ~/code/fs/2 $ time ./fs --pants-binary=../../pants/dist/pants.pex compile ads-api
Writing log files to disk in /tmp/davidt/goals
Begin: 2014-10-31 05:29:56.130135
Running: ../../pants/dist/pants.pex goal compile --compile-scala-missing-deps=fatal src/jvm/com/foursquare/ads/server/bin:foursquare.ads
Writing log files to disk in /tmp/davidt/goals
05:29:57 00:00 [main]
(To run a reporting server: ./pants goal server)
05:29:58 00:01 [bootstrap]
@dt
dt / tag.py
Last active August 29, 2015 14:06
BUILD graph rules
# Copyright 2014 Foursquare Labs Inc. All Rights Reserved.
from pants.backend.core.tasks.task import Task
class Tagger(Task):
@classmethod
def product_types(cls):
return ['tagged_build_graph']
def execute(self):
### Keybase proof
I hereby claim:
* I am dt on github.
* I am davidtaylor (https://keybase.io/davidtaylor) on keybase.
* I have a public key whose fingerprint is C1C7 28C0 61A1 AF42 37E5 3469 769C 56D5 F1B4 6954
To claim this, I am signing this object:
com
foursquare
foo
client [fsthriftclient for 'foo']
server
bin [main method(s) and concrete bag]
concrete [implementation of services used in 'endpoint' or 'rpc']
endpoint
json
frontend [self-hosted/internal web pages]
scala> List(1, 2, 3).toSet()
[[syntax trees at end of typer]] // <console>
package $line3 {
object $read extends scala.AnyRef {
def <init>(): $line3.$read.type = {
$read.super.<init>();
()
};
object $iw extends scala.AnyRef {
def <init>(): type = {
@dt
dt / lightup.sh
Created October 14, 2013 19:56
lightup script
#!/bin/bash
echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo 1 > /sys/class/gpio/gpio18/value
LAST=`curl -s https://api-davidt-staging.foursquare.com/norep.id`
echo "`date` starting up..."
echo "`date` initial id: $LAST"
killfile=/opt/watcher.kill
@dt
dt / udpserver.java
Created August 4, 2013 16:53
UDP Echo Server
import java.io.*;
import java.net.*;
class UDPServer {
public static void main(String args[]) throws Exception {
if (args.length < 1) {
System.out.println("usage: java UDPServer <port>");
} else {
int listen = Integer.parseInt(args[0]);
try {
@dt
dt / watcher.sh
Last active December 18, 2015 12:49
light-on-new-thing.sh
#!/bin/bash
echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo 1 > /sys/class/gpio/gpio18/value
LAST=`curl -s https://api-davidtaylor-staging.foursquare.com/latest.id`
echo 0 > /sys/class/gpio/gpio18/value
sleep 2
echo 1 > /sys/class/gpio/gpio18/value
echo "waiting..."
@dt
dt / rdio_ugly_bar
Created May 29, 2013 20:10
kill the ugly rdio bar
.Canvas_Blur canvas {
display: none !important;
}
.Canvas_Blur {
background-color: #ffffff !important;
height: 91px;
}
.App_PlayerFooter {
height: 70px !important;
}
Hello,
I'm sorry about the problem you had with the delivery of your order. I understand the inconvenience on your part and this is definitely not what we want for our customer to experience.
I want to make things right for you so I've forwarded your feedback about USPS to our shipping department--I know they'll want to hear about your experience. We're aware that our choice of delivery services reflects on our business as a whole, and we appreciate your feedback.
Further, I want to compensate for this; so in case you'll place another order from our website, please have it via One Day Shipping and we will waive the shipping cost. Please make sure that the item is sold and shipped by Amazon or at least Fulfilled-by-Amazon.
One of our aims at Amazon.com is to provide a convenient and efficient service; in this case, we haven't met that standard. I'm truly sorry, and I hope you'll give us another chance in the future.