Skip to content

Instantly share code, notes, and snippets.

@ckib16
ckib16 / README with MIT.md
Last active January 12, 2025 18:05
Default README template with the MIT license text.

QuickMarks

QuickMarks is an analytics app for web projects. It helps you track events on your websites. It is built using Rails, Devise, and a few charting libraries.

Quickmarks analytics offers a few key features:

  • A client-side JavaScript snippet that allows a user to track events on their website
  • A server-side API that captures and saves those events to a database
  • A Rails application that displays the captured event data for a user

Installation

@ckib16
ckib16 / README.md
Last active August 29, 2015 14:21 — forked from zenorocha/README.md

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@ckib16
ckib16 / gist:8b1d1a7cdd4fed17b8ad
Created March 2, 2015 22:35
Stuck on bookmark_id
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable
has_many :topics, dependent: :destroy
has_many :bookmarks, through: :topics, dependent: :destroy
has_many :likes, dependent: :destroy
@ckib16
ckib16 / Papertrail error log from Heroku and Mailgun (Blocmarks US #3)
Created February 1, 2015 20:40
Papertrail error log from Heroku and Mailgun (Blocmarks US #3)
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: => Booting WEBrick
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: => Rails 4.2.0 application starting in production on http://0.0.0.0:59955
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: => Run `rails server -h` for more startup options
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: => Ctrl-C to shutdown server
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: Started POST "/incoming" for 173.203.37.137 at 2015-02-01 20:21:34 +0000
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: User Load (15.6ms) SELECT "users".* FROM "users" WHERE ([email protected]) LIMIT 1
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: Processing by IncomingController#create as */*
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: PG::UndefinedTable: ERROR: relation "users" does not exist
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: LINE 1: SELECT "users".* FROM "users" WHERE ([email protected]) LIMI...
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: ^
# This interceptor just makes sure that local mail
# only emails you.
# http://edgeguides.rubyonrails.org/action_mailer_basics.html#intercepting-emails
class DevelopmentMailInterceptor
def self.delivering_email(message)
message.to = '[email protected]'
message.cc = nil
message.bcc = nil
end
end
@ckib16
ckib16 / gist:11987af8e74cf74cd494
Created December 27, 2014 05:38
Need to delete 'image' string from users db table
create_table "users", force: true do |t|
t.string "name"
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
@ckib16
ckib16 / topics_controller.rb
Created December 21, 2014 20:23
refactored controller with topics_params method
def create
@topic = Topic.new(topics_params)
authorize @topic
if @topic.save
redirect_to @topic, notice: "Topic was saved successfully."
else
flash[:error] = "Error creating topic. Please try again."
render :new
end
end
@ckib16
ckib16 / gist:95a1280b6afa40128cb3
Last active August 29, 2015 14:09
Loop Checkpoint - "Title Case" exercise: Conditional logic not working; elsif condition was never met
# Downcase everything to normalize
#
require 'pry'
class Title
attr_accessor :string
def initialize(string)
@ckib16
ckib16 / gist:8be71677026ed8c4a7d5
Created November 3, 2014 00:38
Toaster description
In just a few sentences, the message should describe a toaster (the kitchen appliance) in the terminology of a programming method.
What is/are its expected argument(s)?
- The toaster method should accept any toastable food as arguments (bread, bagle, pop-tarts)
What does it return?
- The Toaster method should return it's arguments that have been toasted, or heated until crispy but not burnt.
What are its side effects?
- Side effects include electricity used, heat produced, and time taken
@ckib16
ckib16 / gist:4fcfb18e8a831644a846
Created September 1, 2014 21:50
Still have .pop method undefined?!
# blackjack_oop.rb
# Requirements
# - Dealer has a deck of cards. The cards are shuffled and dealt to the Dealer and Player. The player and dealer calculate their hands. If dealer has 21, game is over. If player has 21, player wins. If both have 21, they tie (push). If neither, play continues
# If play continues, player is asked to hit or stay. If player hits, new card is dealt and new caluclation made for <21, ==21 or >21. If <21, player can hit or stay. If ==21, player wins or ties is dealer aslo has 21. If >21 player loses.
# If player stays, dealer takes turn. Dealer must hit if <=16, and wil stay at >=17. If dealer, busts, palyer wins. If dealer stays at >= 17 and does not bust, compare score to player. Player with higher score wins. Game resets.
# Major nouns: