This file contains hidden or 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 sublime, sublime_plugin | |
CLASSES = sublime.CLASS_WORD_START | sublime.CLASS_PUNCTUATION_START | sublime.CLASS_LINE_END | |
class ScalaAddImportLine(sublime_plugin.TextCommand): | |
def run(self, edit, sym): | |
end_of_imports = self.view.find_all('import .*\n\n') | |
if len(end_of_imports) != 1: | |
raise ValueError('where do i put this import?!') | |
else: |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
if [ ! -d .pvenvs/onchange ]; then | |
mkdir -p .pvenvs | |
python2.7 -m virtualenv --quiet .pvenvs/onchange | |
if [ $(uname) = 'Darwin' ]; then | |
.pvenvs/onchange/bin/pip install --quiet MacFSEvents | |
else |
This file contains hidden or 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
light <- hardware.pin8; | |
light.configure(ANALOG_IN); | |
was_brewing <- false; | |
brew_light <- 45000; | |
poll_time <- 30; | |
skip_updates <- 10; | |
until_heartbeat <- 0; |
This file contains hidden or 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
# coding=utf-8 | |
# Copyright 2013 Foursquare Labs Inc. All Rights Reserved. | |
from __future__ import absolute_import | |
import os | |
import subprocess | |
from pants.backend.core.tasks.task import Task | |
from pants.backend.python.targets.python_binary import PythonBinary |
This file contains hidden or 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
class ProductiveJUnitRun(JUnitRun): | |
@classmethod | |
def product_types(cls): | |
return ['junit_tests_ran'] | |
task(name='junit', | |
action=ProductiveJUnitRun, | |
dependencies=['bootstrap', 'compile']).install('test', replace=True).with_description('Test compiled code.') |
This file contains hidden or 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
brew_light <- 55000; | |
brewing <- false; | |
slack_url <- "https://hooks.slack.com/services/BLAHBLAHBLAH"; | |
function slack(msg) { | |
local body = "{\"text\": \""+msg+"\", \"username\": \"Coffeebot\", \"icon_emoji\": \":coffee:\"}"; | |
local request = http.post(slack_url, {}, body); | |
local resp = request.sendsync(); | |
server.log("Slack says ("+resp.statuscode + "): " + resp.body) | |
} |
This file contains hidden or 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
light <- hardware.pin8; | |
light.configure(ANALOG_IN); | |
function check() { | |
agent.send("lvl", light.read()); | |
imp.wakeup(10, check); | |
} | |
check(); |
This file contains hidden or 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
# def slow_identity_func(i): | |
# import time | |
# time.sleep(i[0]) | |
# return i[1] | |
# def test_multiproc_map_timeout(self): | |
# context = create_context() | |
# msg = 'subproc_map result still not ready...' | |
# counting_log = MockLogger(count_messages_matching=set([msg])) | |
# context._log = counting_log |
This file contains hidden or 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
[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] |
This file contains hidden or 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
# 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): |