Skip to content

Instantly share code, notes, and snippets.

View kronosapiens's full-sized avatar
💭
Staring off into space.

Daniel Kronovet kronosapiens

💭
Staring off into space.
View GitHub Profile
@kronosapiens
kronosapiens / .bash_profile
Created September 15, 2014 15:25
My .bash_profile
# Configuring Our Prompt
# ======================
# This function is called in your prompt to output your active git branch.
# function parse_git_branch {
# git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
# }
# Add this parse_git_dirty function.
@kronosapiens
kronosapiens / Terminal Log for Arel "includes" vs. "joins"
Last active August 29, 2015 13:57
Terminal Log for Arel "includes" vs. "joins"
[1] pry(Boat)> ActiveRecord::Base.logger = Logger.new(STDOUT)
=> #<Logger:0x00000104286068
@default_formatter=#<Logger::Formatter:0x00000104286040 @datetime_format=nil>,
@formatter=nil,
@level=0,
@logdev=
#<Logger::LogDevice:0x00000104285ff0
@dev=#<IO:<STDOUT>>,
@filename=nil,
@mutex=
@kronosapiens
kronosapiens / Output for Rack::Builder.parse_file('config.ru').first
Created March 12, 2014 12:21
Output for Rack::Builder.parse_file('config.ru').first
#<Rack::Static:0x00000101c65c08
@app=
#<LandmarksController app_file="/Users/kronosapiens/Dropbox/Documents/Development/code/flatiron/wk5/nyc-sinatra-ruby-004/app/controllers/application_controller.rb">,
@file_server=
#<Rack::File:0x00000101c65938
@default_mime="text/plain",
@headers={},
@root="public">,
@header_rules=[],
@headers={},
@kronosapiens
kronosapiens / rspec_helper for sinatra-complex-forms-ruby-004
Created March 12, 2014 00:49
rspec_helper for sinatra-complex-forms-ruby-004
ENV["SINATRA_ENV"] = "test"
require_relative '../config/environment'
require 'rack/test'
require 'capybara/rspec'
require 'capybara/dsl'
if defined?(ActiveRecord::Migrator) && ActiveRecord::Migrator.needs_migration?
raise 'Migrations are pending run `rake db:migrate SINATRA_ENV=test` to resolve the issue.'
end
@kronosapiens
kronosapiens / Solution to Project Euler #3
Last active August 29, 2015 13:57
Solution to Project Euler #3
# [08:31:21] euler
# ƒ: ruby 03_lpf.rb
# 71
# 839
# 1471
# 6857
# 0.020000 0.000000 0.020000 ( 0.013420)
require 'pry'
require 'prime'
@kronosapiens
kronosapiens / Seeds for NYC App
Created March 6, 2014 22:59
Seeds for NYC App
bqe = Landmark.create(name: 'BQE', year_completed: 1961)
sol = Landmark.create(name: 'Statue of Liberty', year_completed: 1886)
esb = Landmark.create(name: 'Empire State Building', year_completed: 1929)
mos = Figure.create(name: 'Bobby Moses')
fdr = Figure.create(name: 'FDR')
pc = Title.create(name: 'Parks Commissioner')
president = Title.create(name: 'President')
hero = Title.create(name: 'Hero')
@kronosapiens
kronosapiens / index.html code
Created February 20, 2014 23:23
Code to create the movies index.html
index.write(
<<-HTML
<!DOCTYPE html>
<html>
<head>
<title>Movies</title>
</head>
<body>
<ul>
#{Movie.all.map {|movie| "<li><a href=\"movies/#{movie.url}\">#{movie.title}</a></li>\n"}.join(" ")} </ul>
@kronosapiens
kronosapiens / gist:8798994
Last active August 29, 2015 13:56
daniel_kronovet-bio
Name: Daniel Kronovet
Github: http://github.com/kronosapiens
Blog: http://kronosapiens.com
Tagline: I Am a Strange Loop
Excerpt: California native gone home to New York, looking for a challenge.
Profile Picture: http://kronosapiens.files.wordpress.com/2014/02/morgans_wedding.jpg?w=339
Treehouse Account: http://teamtreehouse.com/kronosapiens