I hereby claim:
- I am jeregrine on github.
- I am peregrine (https://keybase.io/peregrine) on keybase.
- I have a public key whose fingerprint is 95F5 DBCD 84B3 A773 7308 9222 3C23 D809 EF15 3FD2
To claim this, I am signing this object:
1) test Initates a connection proper. (Phoenix.Router.RawWebsocketHandlerTest) | |
** (UndefinedFunctionError) undefined function: Socket.TCP.packet!/2 | |
stacktrace: | |
Socket.TCP.packet!(:raw, {Socket.TCP, #Port<0.20319>, nil, {:resource, 305923944, ""}}) | |
lib/socket/web.ex:210: Socket.Web.connect!/3 | |
lib/socket/web.ex:140: Socket.Web.connect/3 | |
test/phoenix/websocket_handler_test.exs:24: Phoenix.Router.RawWebsocketHandlerTest."test Initates a connection proper."/1 |
I hereby claim:
To claim this, I am signing this object:
'''Provides utility functions for encoding and decoding linestrings using the | |
Google encoded polyline algorithm. | |
''' | |
def encode_coords(coords): | |
'''Encodes a polyline using Google's polyline algorithm | |
See http://code.google.com/apis/maps/documentation/polylinealgorithm.html | |
for more information. | |
defmodule Roadcast.Google.Polyline do | |
use Bitwise | |
#TODO Work on this code | |
def decode(polyline) when is_binary(polyline) do | |
decode(lc <<x>> inbits polyline, do: x - 63) | |
end | |
def decode(coll) when is_list(coll) do | |
coll |
gem 'rest-client', '~> 1.6.7' | |
gem 'nokogiri' |
# Simple Phoenix authentication plug | |
# | |
# - based on Plug's session store | |
# - redirects unauthenticated requests to login page "/login/<request url>" | |
# - /static/... requests are not authenticated | |
# - authentication is valid as long as session is valid (you can change this behaviour easily) | |
# Because we need session to be fetched BEFORE this plug, we must put this to router.ex: | |
#---------------------------- |
def save_and_after_commit(&block) | |
Sequel::Model.db.transaction do | |
Sequel::Model.db.after_commit(&block) | |
self.save | |
end | |
end |
#!/usr/bin/env python | |
import random | |
obliqstrats = ['(Organic) machinery', '(This Line Intentionally Left Blank)', 'A line has two sides', 'A very small object -Its centre', 'Abandon desire', 'Abandon normal instructions', 'Accept advice', 'Accretion', 'Adding on', 'Allow an easement (an easement is the abandonment of a stricture)', 'Always first steps', 'Always give yourself credit for having more than personality', 'Always the first steps', 'Are there sections? Consider transitions', 'Ask people to work against their better judgement', 'Ask your body', 'Assemble some of the elements in a group and treat the group', 'Back up a few steps. What else could you have done?', 'Balance the consistency principle with the inconsistency principle', 'Be dirty', 'Be extravagant', 'Be less critical more often', 'Breathe more deeply', 'Bridges -build -burn', 'Call your mother and ask her what to do.', 'Cascades', 'Change ambiguities to specifics', 'Change instrument roles', 'Change nothing and continue with immaculate c |
defmodule MyApp.MyModelController do | |
use MyApp.Web, :controller | |
plug :action | |
def show(conn, params) do | |
json conn, Repo.get!(MyModel, params[:id]) | |
end | |
end |
defmodule MyApp.CommentView do | |
use MyApp.Web, :view | |
@attributes ~W(id name inserted_at) | |
def render("show.json", data: data) when is_list(data) do | |
for c <- data do | |
render("show.json", data: data) | |
end | |
end | |