Skip to content

Instantly share code, notes, and snippets.

@iamvery
iamvery / lambda-calculus.ipynb
Last active August 1, 2018 01:18
A little Jupyter notebook illustrating some basic lambda calculus with JavaScript :)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
defmodule PantsWeb.ChangesetView do
use PantsWeb, :view
@doc """
Traverses and translates changeset errors.
See `Ecto.Changeset.traverse_errors/2` and
`PantsWeb.ErrorHelpers.translate_error/1` for more details.
"""
def translate_errors(changeset) do
diff --git a/lib/pants_web/endpoint.ex b/lib/pants_web/endpoint.ex
index c24852a..a8ae2cf 100644
--- a/lib/pants_web/endpoint.ex
+++ b/lib/pants_web/endpoint.ex
@@ -45,7 +45,19 @@ defmodule PantsWeb.Endpoint do
signing_salt: "HqMY6W5G"
)
- plug(PantsWeb.Router)
+ def version(conn, []) do
quote do: {:a, :b, :c}
value = {:a, :b, :c}
Macro.escape(value)
quote do: value
value = {:a, :b, :c}
quote do: unquote(value)
{
"name": "frontier",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "~19.0.0",
"react-dom": "16.0.0-alpha.12",
"react-native-dotenv": "^0.1.0",
"react-native-scripts": "1.1.0",
"react-test-renderer": "16.0.0-alpha.12"
@iamvery
iamvery / una
Last active November 6, 2017 19:28
// Relevant links:
// - This pen https://goo.gl/98wWXr
// - Complete example https://goo.gl/aYazLi (DON'T CHEAT! xD)
// - Server source code https://goo.gl/g2dcdC (not needed, but you might be interested)
let Topics = ({topics, setTopic}) =>
<div>
<h4>Click on a topic...</h4>
<ul>
{topics.map(topic => <li><a href="#" onClick={() => setTopic(topic)}>{topic}</a></li>)}
RSpec.describe 'pairing elements of an array' do
def find_pairs(arr)
[] # ???
end
it 'returns a pair iterating through the array one element at a time' do
a = [1,2,3,4]
pairs = find_pairs(a)
expect(pairs).to eq([[1,2],[2,3],[3,4]])
end
<h2>Log in</h2>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<div class="field">
<%= f.label :password %><br />