Skip to content

Instantly share code, notes, and snippets.

➜ ~ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
➜ ~ brew install llvm
Warning: llvm-3.5.1 already installed
➜ ~ brew install ruby-install --HEAD
==> Cloning https://github.com/postmodern/ruby-install.git
Cloning into '/Library/Caches/Homebrew/ruby-install--git'...
remote: Counting objects: 108, done.
remote: Compressing objects: 100% (92/92), done.
remote: Total 108 (delta 2), reused 51 (delta 0), pack-reused 0
➜ trophus-rails git:(master) git push heroku master
Counting objects: 26, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (24/24), done.
Writing objects: 100% (26/26), 9.30 KiB | 0 bytes/s, done.
Total 26 (delta 9), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
➜ 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
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'
<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"
@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 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 / 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",
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 / 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