Skip to content

Instantly share code, notes, and snippets.

View danlamanna's full-sized avatar
🏠
Working from home

Dan LaManna danlamanna

🏠
Working from home
View GitHub Profile
(prodigy-define-service
:name "Girder Dev"
:command "python"
:cwd "/home/dan.lamanna/projects/girder"
:args '("-m" "girder")
:init (lambda ()
(venv-workon "girder-source"))
:tags '(girder))
(prodigy-define-service
filter: function(data) {
data = d3.nest()
.key(function(d) {
return d.date;
})
.rollup(function(d) {
return d3.sum(d, function(g) {
return g.value;
});
}).entries(data);
60: Saved phantom_error_screenshot.png
60: <DartMeasurementFile name="PhantomErrorScreenshot" type="image/png">/home/dan.lamanna/projects/girder/phantom_error_screenshot.png</DartMeasurementFile>
60: Retrying test
60: FAIL
60:
60: ======================================================================
60: FAIL: testWebClientSpec (tests.web_client_test.WebClientTestCase)
60: ----------------------------------------------------------------------
60: Traceback (most recent call last):
60: File "tests/web_client_test.py", line 188, in testWebClientSpec
The following tests FAILED:
22 - py_coverage (Failed)
50 - server_system (Failed)
57 - web_client_data_gridfs (Failed)
58 - web_client_data_gridfsrs (Failed)
71 - web_client_swagger (Failed)
95 - server_geospatial.geospatial (Failed)
103 - server_hdfs_assetstore.assetstore (Failed)
107 - server_thumbnails.thumbnail (Failed)
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# prod box
config.vm.define "prod" do |prod|
prod.vm.box = "hashicorp/precise32"
prod.vm.network "private_network", ip: "192.168.33.10"
end
# dev box
import urllib, sys
from bs4 import BeautifulSoup
page = urllib.urlopen("https://ualbanydining.com/dining-choices/resident/indian.html")
soup = BeautifulSoup(page.read())
links = soup.select("#accordion_4736 ul li a")
if not links:
print "Couldn't find link.."
### Keybase proof
I hereby claim:
* I am danlamanna on github.
* I am danlamanna (https://keybase.io/danlamanna) on keybase.
* I have a public key whose fingerprint is 1A36 96EE 9810 E0CF 2440 4F97 C23D E52B F50E C448
To claim this, I am signing this object:
(add-hook 'elfeed-new-entry-hook
(elfeed-make-tagger :feed-url "fivethirtyeight\\.com"
:entry-title '(not "NFC\\|AFC\\|NBA\\|Football\\|Quarterback\\|Super Bowl")
:add 'junk
:remove 'unread
:callback '(lambda(entry)
(message "Discarding %s" (elfeed-entry-title entry)))))
n = 12427281805225 # 3525235
# brute force, ~.5s
for i in xrange(1, n):
if i**2 == n:
print i
break
# binary search.. ~.06s
def find_sq_root(n, lower=1, upper=n):
public static String reverse_words(String str) {
String[] parts = str.split(" ");
String reversed = "";
for (int i=parts.length-1;i>=0;i--) {
reversed += parts[i] + " ";
}
return reversed;
}