Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

stochastic-thread

🎯
Focusing
Block or report user

Report or block stochastic-thread

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
@stochastic-thread
stochastic-thread / addTwoNumbers.py
Created Sep 25, 2018
Solution to LeetCode Algorithms #2 - "Add Two Numbers"
View addTwoNumbers.py
class Solution:
def addTwoNumbers(self, l1, l2):
"""
:type l1: ListNode
:type l2: ListNode
:rtype: ListNode
"""
_sum = 0
dummy = ListNode(0)
current, carry = dummy, 0
View gist:abd457b812ab3d59cb60a2d592638dce
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)
View neo4j_startup
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.
View gist:634c9bd1e67b566173ff313ae3543ae0

$> 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.

View output of foreground.ex
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
View ectoChangeset.ex
{: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",
View registration_controller.ex
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 Nov 25, 2015
Endpoint terminating, "the response was already sent" (Plug.Conn.AlreadySentError)
View errors.ex
[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
View gist:c51c5a99410a3b75c275
WebSocket connection to 'wss://www.trophus.com/ws/websocket?logger=function%20logger(kind%2C%20msg%2…3A%20%22%20%2B%20msg%2C%20data)%3B%0A%20%20%20%20%20%20%20%20%7D&vsn=1.0.0' failed: Error during WebSocket handshake: Unexpected response code: 403
You can’t perform that action at this time.