Skip to content

Instantly share code, notes, and snippets.

View cdesch's full-sized avatar
🏠
Working from home

cdesch cdesch

🏠
Working from home
View GitHub Profile
#ActiveAdmin User
ActiveAdmin.register User do
index do
column :email
column :alias
column :current_sign_in_at
column :last_sign_in_at
column :sign_in_count
default_actions
end
<% entry = @featured_entries.first %>
<article class="entry style-grid style-hero hero-sm-largest type-post col-sm-12 col-md-6 colheight-sm-1 colheight-md-2 colheight-lg-2 colheight-xl-2">
<div class="ribbon ribbon-pulled ribbon-small ribbon-highlight">
<%= link_to entry.category.try(:name), entry.category %>
</div>
<header class="entry-header">
<h3 class="entry-title"><%= link_to entry.title, entry %></h3>
cjs-MacBook-Pro-4:myapp cj$ bundle exec rake --tasks --trace
rake aborted!
undefined method `each' for nil:NilClass
/Users/cj/RubymineProjects/myapp/config/application.rb:24:in `<class:Application>'
/Users/cj/RubymineProjects/myapp/config/application.rb:10:in `<module:myapp>'
/Users/cj/RubymineProjects/myapp/config/application.rb:9:in `<top (required)>'
/Users/cj/RubymineProjects/myapp/Rakefile:4:in `require'
/Users/cj/RubymineProjects/myapp/Rakefile:4:in `<top (required)>'
/Users/cj/.rvm/gems/ruby-2.0.0-p247@myapp/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load'
/Users/cj/.rvm/gems/ruby-2.0.0-p247@myapp/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load_rakefile'
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
#Bundler.require(:default, Rails.env)
module MyApp
class Application < Rails::Application
development:
facebook_key: "MyKeyRemoved"
facebook_secret: "MyKeyRemoved"
twitter_key: "YOUR_KEY"
twitter_secret: "YOUR_SECRET"
github_key: "YOUR_KEY"
github_secret: "YOUR_SECRET"
@cdesch
cdesch / Code
Last active August 29, 2015 14:00
def index
@events = Event.where("published == ? AND event_date >= ?", true, DateTime.now.beginning_of_day).order('event_date ASC').limit(6)
end
Started GET "/admin/events/3/edit" for 127.0.0.1 at 2014-06-18 09:35:45 -0400
Processing by Admin::EventsController#edit as HTML
Parameters: {"id"=>"3"}
AdminUser Load (0.2ms) SELECT "admin_users".* FROM "admin_users" WHERE "admin_users"."id" = 1 ORDER BY "admin_users"."id" ASC LIMIT 1
Event Load (0.1ms) SELECT "events".* FROM "events" WHERE "events"."id" = ? LIMIT 1 [["id", "3"]]
Event Load (0.2ms) SELECT "events".* FROM "events" WHERE "events"."id" = 3 ORDER BY "events"."id" ASC LIMIT 1
Type Load (0.2ms) SELECT "types".* FROM "types"
Type Load (0.2ms) SELECT "types".* FROM "types" WHERE "types"."id" = ? ORDER BY "types"."id" ASC LIMIT 1 [["id", 2]]
Category Load (0.1ms) SELECT "categories".* FROM "categories"
Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? ORDER BY "categories"."id" ASC LIMIT 1 [["id", 2]]
ActiveAdmin.register Event do
index do
column :title
column :short_description
column :event_date
column :published
column :type
column :category
@cdesch
cdesch / docs.html
Created July 31, 2014 17:32
Google Docs Comic 1
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">
@cdesch
cdesch / comic.html
Created July 31, 2014 18:10
Google Doc Comic 2
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">