Skip to content

Instantly share code, notes, and snippets.

from pants.backend.codegen.targets.python_thrift_library import PythonThriftLibrary
from pants.backend.codegen.tasks.simple_codegen_task import SimpleCodegenTask
from pants.backend.jvm.jar_dependency_utils import M2Coordinate, ResolvedJar
from pants.backend.jvm.repository import Repository
from pants.backend.jvm.subsystems.scala_platform import ScalaPlatform
from pants.backend.jvm.targets.exclude import Exclude
from pants.backend.jvm.targets.exportable_jvm_library import ExportableJvmLibrary
from pants.backend.jvm.targets.jarable import Jarable
from pants.backend.jvm.targets.jar_dependency import JarDependency
from pants.backend.jvm.targets.jar_library import JarLibrary
@mateor
mateor / output.txt
Created April 14, 2016 21:37
PANTS_CONFIG_FILES repro
mateo:pants mateo$ mv pants.ini renamed-pants.ini
mateo:pants mateo$ PANTS_CONFIG_FILES=renamed-pants.ini ./pants test contrib/scrooge::
Exception caught: (<type 'exceptions.IOError'>)
File "/Users/mateo/dev/pants/src/python/pants/bin/pants_exe.py", line 50, in <module>
main()
File "/Users/mateo/dev/pants/src/python/pants/bin/pants_exe.py", line 44, in main
PantsRunner(exiter).run()
File "/Users/mateo/dev/pants/src/python/pants/bin/pants_runner.py", line 47, in run
global_bootstrap_options = options_bootstrapper.get_bootstrap_options().for_global_scope()
File "/Users/mateo/dev/pants/src/python/pants/option/options_bootstrapper.py", line 103, in get_bootstrap_options
@mateor
mateor / bubblesort.py
Last active April 10, 2016 23:09
Bubblesort - in case you have to sort shit but also have some time to kill
# The MIT License (MIT)
# Copyright (c) 2016 mateor
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
@mateor
mateor / mergesort.py
Last active April 10, 2016 23:04
mergesort for you and all your unsorted friends
# The MIT License (MIT)
# Copyright (c) 2016 mateor
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH T
@mateor
mateor / nginx.conf
Last active March 25, 2016 14:41
nginx conf used by Foursquare's artifact cache
# NOTE: 2 cpu cores
worker_processes 2;
error_log /data/log/nginx/error.log;
events {
# NOTE: Accept as many connections as possible, after nginx gets notification about a new connection.
# May flood worker_connections, if that option is set too low.
multi_accept on;
# NOTE: ulimit -n
@mateor
mateor / output.txt
Created February 2, 2016 22:39
Change the ivy version in build-support/ivy/ivy.xml to 2.3.0
Last login: Sat Jan 30 23:58:47 2016
mateor@ubuntu:~$ rm -rf ~/.cache/pants/
mateor@ubuntu:~$ cd dev/pants/
mateor@ubuntu:~/dev/pants$ ./pants compile src::
INFO] Detected git repository at /home/mateor/dev/pants on branch master
23:04:07 00:00 [main]
(To run a reporting server: ./pants server)
23:04:07 00:00 [setup]
23:04:07 00:00 [parse]
@mateor
mateor / SAP_CLA
Created December 21, 2015 17:51 — forked from CLAassistant/SAP_CLA
SAP Individual Contributor License Agreement
###SAP Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by SAP SE or its affiliates (“SAP”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to SAP in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact [email protected].
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
**Copyright License.** You hereby grant, and agree to grant, to SAP a non-exclusive, perpetual, irrevocable, worldwid
@mateor
mateor / gist:3a4657a459215c3ef144
Created November 20, 2015 18:48
class file for org.apache.thrift.TBase not found.
mateo:pants mateo$ git log
commit 3484a8f26dac7177097b394a765649791a03ba43
Author: Matt Olsen <[email protected]>
Date: Fri Nov 20 10:23:31 2015 -0800
Isolate .pex dir
Ensure that we don't interfere with the users .pex directory in case
they use pex outside of pants.
@mateor
mateor / pants_exe._run()
Created September 27, 2015 23:22
python profiling in pants snippet. Install guppy into the virtual env (env/bin/pip install guppy).
def _run(exiter):
# We want to present warnings to the user, set this up early to ensure all warnings are seen.
# The "default" action displays a warning for a particular file and line number exactly once.
# See https://docs.python.org/2/library/warnings.html#the-warnings-filter for the complete action
# list.
warnings.simplefilter('default')
# Bootstrap options and logging.
options, build_config = OptionsInitializer().setup()
@mateor
mateor / ivysettings.xml
Created May 22, 2015 18:04
Simple ivysettings.xml to interact with Android SDk (Google libraries and Android Support libraries)
<?xml version="1.0"?>
<!--
Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
Licensed under the Apache License, Version 2.0 (see LICENSE).
-->
<ivysettings>
<properties environment="env" />
<property name="env.ANDROID_HOME" value="/please-export-your-ANDROID_HOME" override="false"/>
<property name="android.repo.dir" value="${env.ANDROID_HOME}/extras/android/m2repository"/>