Skip to content

Instantly share code, notes, and snippets.

Compiled lib/life.ex
Generated life app
Interactive Elixir (1.1.0-dev) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> life = Life.start_link
** (ArgumentError) argument error
:erlang.send({:ok, #PID<0.126.0>}, {:add, "https://api.instagram.com/v1/users/self/media/recent?access_token=1531139.f18ce1e.1353009936304f85921167c58a591475"})
(life) lib/life.ex:4: Life.start_link/0
iex(1)>
defmodule Death do
def start do
spawn(fn -> loop() end)
end
def loop do
receive do
{:speak} ->
IO.puts "Arthur says hi"
loop
@stochastic-thread
stochastic-thread / life.ex
Created June 18, 2015 10:21
hello fetch
defmodule Life do
def start do
spawn(fn -> loop([]) end)
end
defp loop(list_perm) do
receive do
{:add, url} ->
IO.puts "hey"
resp = HTTPoison.get! url
defmodule HelloPhoenix.Repo.Migrations.AddAuthInfoToUsers do
use Ecto.Migration
def up do
"""
ALTER TABLE users ADD COLUMN username varchar(200);
ALTER TABLE users ADD COLUMN hash varchar(130);
ALTER TABLE users ADD COLUMN recovery_hash varchar(130);
ALTER TABLE users ADD CONSTRAINT u_constraint UNIQUE (email);
"""
@stochastic-thread
stochastic-thread / gist:5e7b9923beb05f3065ba
Created June 16, 2015 02:30
Phoenix template url list not rendering

So I know that the general logic of my code works because I used Enum.fetch! @images, 0 and it did correctly render the image in my instagram.html.eex template.

images = 
["https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s150x150/e15/11379745_1585313748409462_103808145_n.jpg",
 "https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s150x150/e15/11379061_1580569178876434_1167877115_n.jpg",
 "https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s150x150/e15/11356353_720047521439521_517049214_n.jpg",
 "https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s150x150/e15/11380197_942331749159310_1992474397_n.jpg",
 "https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s150x150/e15/11352262_665047260292000_1054860417_n.jpg",
 "https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s150x150/e15/11386498_990626080949891_1423590947_n.jpg",
<script id="template-upload" type="text/x-tmpl">
<div id="file-{%=o.unique_id%}" class="upload">
{%=o.name%}
<div class="progress"><div class="bar" style="width: 0%"></div></div>
</div>
</script>
<%= form_for(@dish, :html => { :multipart => true, :class => "directUpload" }) do |f| %>
@stochastic-thread
stochastic-thread / logs.rb
Created June 11, 2015 18:56
Log of request
Geokit is using the domain:
testing location
39.0526
-77.121
Rendered pages/map2.html.erb within layouts/application (0.0ms)
Rendered layouts/_analytics.html.erb (0.1ms)
Rendered layouts/_cdn.html.erb (6.7ms)
Rendered layouts/_stripe.html.erb (0.1ms)
Rendered layouts/_sidenav.html.erb (0.6ms)
Rendered layouts/_header3.html.erb (13.2ms)
<script>
$.get("http://ipinfo.io", function(response) {
//console.log(response.loc);
var loc = response.loc;
console.log(response);
console.log(loc);
$.ajax({
url: 'store_temporary_user_location',
data: {"location": loc, "ip": response.ip},
type: "POST"
Rails.root: /Users/arthur/RubymineProjects/trophus
Application Trace | Framework Trace | Full Trace
geokit-rails (2.1.0) lib/geokit-rails/acts_as_mappable.rb:337:in `get_lat'
geokit-rails (2.1.0) lib/geokit-rails/acts_as_mappable.rb:321:in `sphere_distance_sql'
geokit-rails (2.1.0) lib/geokit-rails/acts_as_mappable.rb:193:in `distance_sql'
geokit-rails (2.1.0) lib/geokit-rails/acts_as_mappable.rb:228:in `distance_conditions'
geokit-rails (2.1.0) lib/geokit-rails/acts_as_mappable.rb:108:in `within'
app/views/pages/map2.html.erb:9:in `_app_views_pages_map__html_erb__4457095258998074298_70361908050900'
actionview (4.2.1) lib/action_view/template.rb:145:in `block in render'
➜ trophus-rails git:(master) git push heroku master
Counting objects: 29, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (27/27), done.
Writing objects: 100% (29/29), 9.51 KiB | 0 bytes/s, done.
Total 29 (delta 11), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected