{ "body": { "key": { "eldest_kid": "0120f6e10574deeefaf8a68b284bb1f027683ff28c757cd025010c20ad5ffe13556c0a", "host": "keybase.io", "kid": "0120f6e10574deeefaf8a68b284bb1f027683ff28c757cd025010c20ad5ffe13556c0a", "uid": "1937bc2ddd1811722f0efa789b0c2419", "username": "crankycoder" }, "merkle_root": {
This file contains 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
from math import sqrt | |
phi = (1 + sqrt(5))/2 | |
resphi = 2 - phi | |
# a and b are the current bounds; the minimum is between them. | |
# c is the center pointer pushed slightly left towards a | |
def goldenSectionSearch(f, a, c, b, absolutePrecision): | |
if abs(a - b) < absolutePrecision: | |
return (a + b)/2 | |
# Create a new possible center, in the area between c and b, pushed against c |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Blue Component</key> | |
<real>0.050980392156862744</real> | |
<key>Green Component</key> | |
<real>0.050980392156862744</real> |
This file contains 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 | |
sudo apt-get install git python-is-python3 python3-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl | |
sudo pip install virtualenvwrapper | |
# Official pyenv repos are under github.com/yyuu | |
git clone https://github.com/yyuu/pyenv.git ~/.pyenv | |
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc |
This file contains 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
''' | |
Run this with: | |
env FLASK_APP=foo.py flask run | |
. | |
|'.._ __......._ _.-'. | |
\M\ ^'.-' ''-/ / |
This file contains 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
-bash-4.2$ pytest | |
========================================= test session starts ========================================== | |
platform linux2 -- Python 2.7.12, pytest-3.2.3, py-1.4.34, pluggy-0.4.0 | |
rootdir: /home/hadoop/taar, inifile: | |
plugins: cov-2.5.1 | |
collected 24 items | |
test_collaborativerecommender.py .... | |
test_legacyrecommender.py ... | |
test_localerecommender.py .... |
This file contains 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
## | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Stefan Wendler | |
# | |
# 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 |
This file contains 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
# Building static nginx for teh lulz | |
# | |
# basic dependencies | |
sudo apt-get install libxslt1-dev libxml2-dev zlib1g-dev libpcre3-dev libbz2-dev libssl-dev | |
# download nginx and openssl | |
wget http://nginx.org/download/nginx-1.5.6.tar.gz | |
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6 |
Save books out of Safari Books Online
From http://objectivesea.tumblr.com/post/9033067018/safaribooks
This is hard. I spent way too much time figuring this out, because I was annoyed that a book I bought (Addison-Wesley) was available online for free, except only for 45 days after which payment was required. So I made this hack... probably useful to no one else, but here it is.
Requirements:
- iPad.
- Safari To Go (the Safari Books Online iPad app).
This file contains 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
[UdpInput] | |
address = "127.0.0.1:2514" | |
parser_type = "packet" | |
decoder = "syslog_sandbox" | |
[syslog_sandbox] | |
type = "SandboxDecoder" | |
script_type = "lua" | |
filename = "/tmp/syslog_decoder.lua" | |
timestamp_field = "syslog_ts" |
NewerOlder