Skip to content

Instantly share code, notes, and snippets.

from geopy.geocoders import Nominatim
location = "Rockville, Maryland; USA"
loc = geolocator.geocode(location)
location_payload = {"latitude": loc.latitude, "longtitude": loc.longitude}
print(location_payload)
@stochastic-thread
stochastic-thread / addTwoNumbers.py
Created September 25, 2018 19:03
Solution to LeetCode Algorithms #2 - "Add Two Numbers"
class Solution:
def addTwoNumbers(self, l1, l2):
"""
:type l1: ListNode
:type l2: ListNode
:rtype: ListNode
"""
_sum = 0
dummy = ListNode(0)
current, carry = dummy, 0
Collé Cryptophilanthropic DAO, GmbH
2018-01-28 14:09:17 Bitcoin version v0.15.1
2018-01-28 14:09:17 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-01-28 14:09:17 Assuming ancestors of block 0000000000000000003b9ce759c2a087d52abc4266f8f4ebd6d768b89defa50a have valid signatures.
2018-01-28 14:09:17 Setting nMinimumChainWork=000000000000000000000000000000000000000000723d3581fe1bd55373540a
2018-01-28 14:09:17 Using the 'standard' SHA256 implementation
2018-01-28 14:09:17 Using RdRand as an additional entropy source
2018-01-28 14:09:17 Default data directory /Users/arthurcolle/Library/Application Support/Bitcoin
2018-01-28 14:09:17 Using data directory /Users/arthurcolle/Library/Application Support/Bitcoin
2018-01-28 14:09:17 Using config file /Users/arthurcolle/Library/Application Support/Bitcoin/bitcoin.conf
2018-01-28 14:09:17 Using at most 125 automatic connections (2560 file descriptors available)
Last login: Sat Jan 14 22:53:28 on ttys001
➜ ~ neo4j start
Starting Neo4j.
Started neo4j (pid 3175). By default, it is available at http://localhost:7474/
There may be a short delay until the server is ready.
See /usr/local/Cellar/neo4j/3.1.0/libexec/logs/neo4j.log for current status.

$> conda create --name three python=3.5.1 scipy numpy pandas jupyter

three is name of the environment I'm making

after all the installs occur, run source activate three and then if you want to deactivate, run source deactivate

Within the activated environment, run jupyter notebook to open up a Jupyter notebook.

Using /Users/arthur/Code/ELixir/web_apps/profcolle/rel/profcolle/releases/0.0.1/profcolle.sh
Exec: /Users/arthur/Code/ELixir/web_apps/profcolle/rel/profcolle/erts-7.2.1/bin/erlexec -noshell -noinput +Bd -boot /Users/arthur/Code/ELixir/web_apps/profcolle/rel/profcolle/releases/0.0.1/profcolle -mode embedded -config /Users/arthur/Code/ELixir/web_apps/profcolle/rel/profcolle/running-config/sys.config -boot_var ERTS_LIB_DIR /Users/arthur/Code/ELixir/web_apps/profcolle/rel/profcolle/erts-7.2.1/../lib -env ERL_LIBS /Users/arthur/Code/ELixir/web_apps/profcolle/rel/profcolle/lib -pa /Users/arthur/Code/ELixir/web_apps/profcolle/rel/profcolle/lib/profcolle-0.0.1/consolidated -args_file /Users/arthur/Code/ELixir/web_apps/profcolle/rel/profcolle/running-config/vm.args -- foreground
Root: /Users/arthur/Code/ELixir/web_apps/profcolle/rel/profcolle
@stochastic-thread
stochastic-thread / ectoChangeset.ex
Created November 28, 2015 22:01
Ecto Changeset issue
{:error,
%Ecto.Changeset{action: nil,
changes: %{address_city: "", address_line_1: "401 Nina Place",
address_line_2: "", address_state: "", address_zip: "20852",
crypted_password: "$2b$12$whvz5KJaQQquZG4CSb1f2.Krm0K0/eiQw8.sRLi.FI6/s4FGxQYzu",
email: "qq@qq.com", home: "401 Nina Place, 20852", name: "Quentin QQ",
phone_number: ""},
constraints: [%{constraint: "users_email_index", field: :email,
message: "has already been taken", type: :unique}],
errors: [latitude: "is invalid", longitude: "is invalid",
@stochastic-thread
stochastic-thread / registration_controller.ex
Created November 25, 2015 04:06
Registration Controller
defmodule T.RegistrationController do
use T.Web, :controller
alias T.User
alias Passport.RegistrationManager
plug :action
def new(conn, _params) do
conn
@stochastic-thread
stochastic-thread / errors.ex
Created November 25, 2015 03:47
Endpoint terminating, "the response was already sent" (Plug.Conn.AlreadySentError)
[error] #PID<0.504.0> running T.Endpoint terminated
Server: localhost:4000 (http)
Request: POST /signup
** (exit) an exception was raised:
** (Plug.Conn.AlreadySentError) the response was already sent
(plug) lib/plug/conn.ex:526: Plug.Conn.put_resp_header/3
(phoenix) lib/phoenix/controller.ex:301: Phoenix.Controller.redirect/2
(t) web/controllers/registration_controller.ex:1: T.RegistrationController.action/2
(t) web/controllers/registration_controller.ex:1: T.RegistrationController.phoenix_controller_pipeline/2
(t) lib/phoenix/router.ex:255: T.Router.dispatch/2