Skip to content

Instantly share code, notes, and snippets.

Kris Wilson kwlzn

  • Twitter
  • Santa Cruz, CA
Block or report user

Report or block kwlzn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kwlzn
kwlzn / gist:01694a2e8a1f4083045ba0967092a91d
Created Jul 25, 2018
external pex bootstrapping example
View gist:01694a2e8a1f4083045ba0967092a91d
[omerta ~]$ python2.7
Python 2.7.13 (default, Mar 2 2017, 16:22:01)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named requests
>>>
View gist:77dff3931a16ac80223b831fba17a792
diff --git a/src/rust/engine/process_execution/src/local.rs b/src/rust/engine/process_execution/src/local.rs
index 05e8e3a..a7ed55d 100644
--- a/src/rust/engine/process_execution/src/local.rs
+++ b/src/rust/engine/process_execution/src/local.rs
@@ -1,8 +1,10 @@
extern crate tempfile;
use boxfuture::{BoxFuture, Boxable};
-use fs::{self, GlobMatching, PathGlobs, PathStatGetter, StrictGlobMatching};
+use fs::{self, GlobMatching, PathGlobs, PathStatGetter, Snapshot, StrictGlobMatching};
View gist:fe28eeb4779c1e865f519fcde0d0f44a
diff --git a/src/rust/engine/process_execution/src/local.rs b/src/rust/engine/process_execution/src/local.rs
index 05e8e3a..73ecf5a 100644
--- a/src/rust/engine/process_execution/src/local.rs
+++ b/src/rust/engine/process_execution/src/local.rs
@@ -1,10 +1,12 @@
extern crate tempfile;
use boxfuture::{BoxFuture, Boxable};
-use fs::{self, GlobMatching, PathGlobs, PathStatGetter, StrictGlobMatching};
+use fs::{self, GlobMatching, PathGlobs, PathStatGetter, Snapshot, StrictGlobMatching};
@kwlzn
kwlzn / jupyter_pex.py
Created Jul 17, 2017
jupyter + pex entrypoint shim
View jupyter_pex.py
from contextlib import contextmanager
import errno
import json
import os
import shutil
import sys
import tempfile
from notebook.notebookapp import main as notebook_main
@kwlzn
kwlzn / docstring_grep.py
Created Mar 23, 2017
docstring_grep.py
View docstring_grep.py
#!/usr/bin/env python2.7
import ast
import itertools
import fnmatch
import os
import sys
class DocstringScanner(object):
@kwlzn
kwlzn / datatype.py
Last active Nov 30, 2017
python datatype factory
View datatype.py
#!/usr/bin/env python2.7
import itertools
def datatype(type_name, params):
"""A faster/more efficient namedtuple replacement with better subclassing properties.
>>> RustLibrary = datatype('RustLibrary', ['sources', 'dependencies'])
>>> rl = RustLibrary([1,2,3], [4,5,6])
View gc.txt
cold `./pants list ::`
pre gc, post-execution object count deltas
------------------------------------------
tuple 10409897 +10400188
set 7851229 +7845649
list 5010959 +4998632
StepRequest 3989446 +3989446
Entry 2572224 +2572224
dict 2305074 +2290623
View release.rst

PEX

https://travis-ci.org/pantsbuild/pex.svg?branch=master

pex is a library for generating .pex (Python EXecutable) files which are executable Python environments in the spirit of virtualenvs. pex is an expansion upon the ideas outlined in PEP 441 and makes the deployment of Python applications as simple as cp. pex files may even

@kwlzn
kwlzn / pants_exe.py
Created Sep 15, 2015
yappi profiling
View pants_exe.py
import atexit, yappi
def init_yappi():
print('[YAPPI START]')
yappi.set_clock_type('wall')
yappi.start()
@atexit.register
def finish_yappi():
print('[YAPPI STOP]')
@kwlzn
kwlzn / .slate
Created May 16, 2015
slate config
View .slate
## configs
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
You can’t perform that action at this time.