Skip to content

Instantly share code, notes, and snippets.

💭
Staring off into space.

Daniel Kronovet kronosapiens

💭
Staring off into space.
Block or report user

Report or block kronosapiens

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .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 Aug 29, 2015
Terminal Log for Arel "includes" vs. "joins"
View 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 Mar 12, 2014
Output for Rack::Builder.parse_file('config.ru').first
View 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 Mar 12, 2014
rspec_helper for sinatra-complex-forms-ruby-004
View 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 Aug 29, 2015
Solution to Project Euler #3
View 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'
View 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 Feb 20, 2014
Code to create the movies index.html
View index.html code
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 Aug 29, 2015
daniel_kronovet-bio
View gist:8798994
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
You can’t perform that action at this time.