Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| # Scan for an available port. | |
| # from https://github.com/Workiva/graph_app/compare/master...jasonaguilon-wf:make-test#diff-b67911656ef5d18c4ae36cb6741b7965R128 | |
| PORT ?= $(shell port=32768; while netstat -atn | grep -q :$$port; do port=$$(expr $$port + 1); done; echo $$port) |
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 'dart:isolate' show Isolate, ReceivePort, SendPort; | |
| import 'dart:js' as js show context, JsFunction, JsObject; | |
| import 'package:test/test.dart'; | |
| js.JsObject currentWorker() { | |
| js.JsFunction JsWorkerGlobalScope = js.context['WorkerGlobalScope']; | |
| if (JsWorkerGlobalScope == null) return null; |
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/sh | |
| # Modified from kevincal version in https://gist.github.com/810399 | |
| # The following is a list of the most common PEP 8 errors and warnings; to | |
| # skip some just add them to the IGNORE variable (comma separated): | |
| # E111 indentation is not a multiple of four | |
| # E123 closing bracket does not match indentation of opening bracket's line | |
| # E201 whitespace after '(' | |
| # E202 whitespace before ')' |
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
| In [38]: ids = [uuid.uuid1().hex for n in range(20000)] | |
| In [39]: class Foo(ndb.Model): | |
| ....: bar = ndb.TextProperty(compressed=True, repeated=True) | |
| ....: bazz = ndb.JsonProperty(compressed=True, json_type=list) | |
| ....: | |
| In [40]: len(Foo(bar=ids)._to_pb().Encode()) | |
| Out[40]: 1218594 |
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
| # reST py:function field info | |
| def send_message(sender, recipient, message_body, priority=1) | |
| """Send a message to a recipient | |
| :param str sender: The person sending the message | |
| :param str recipient: The recipient of the message | |
| :param str message_body: The body of the message | |
| :param priority: The priority of the message, can be a number 1-5 | |
| :type priority: integer or None | |
| :return: the message id |
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
| In [22]: root = etree.fromstring('<root xmlns:wf="http://tempuri.org/"><wf:a id="a"><wf:aa id="aa"/><wf:ab id="ab"/><wf:ac id="ac"/></wf:a></root>') | |
| In [23]: d = {'a': root.find(".//{http://tempuri.org/}a[@id='a']")} | |
| In [24]: %timeit root.find(".//{http://tempuri.org/}a[@id='a']") | |
| 100000 loops, best of 3: 2.96 µs per loop | |
| In [25]: %timeit d.get('a') | |
| 10000000 loops, best of 3: 106 ns per loop |
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 list -v | |
| ack gource pkg-config | |
| ant gradle pypy | |
| apple-gcc42 harfbuzz python | |
| autoconf icu4c rbenv | |
| bash jpeg readline | |
| boost lame reattach-to-user-namespace | |
| cairo libass rtmpdump | |
| colortail libevent ruby-build | |
| cscope libffi sdl |
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
| $ curl -s https://gist.github.com/mislav/4728286/raw/rbenv-doctor.sh | bash -x 2>&1 | |
| + rbenv --version | |
| rbenv 0.4.0 | |
| + rbenv versions | |
| system | |
| * 1.8.7-p374 (set by /Users/jason.aguilon/workspaces/docservices/bigsky/.ruby-version) | |
| + rbenv global | |
| system | |
| + env | |
| + grep -E 'PATH|RUBY|BUNDLE|RBENV' |
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 datetime | |
| def utcnow(): | |
| """Return the current time. | |
| Calls are forwarded to another method to enable gloablly patching this | |
| function for tests. | |
| """ | |
| return _utcnow() |
NewerOlder