Skip to content

Instantly share code, notes, and snippets.

View neotericdesign's full-sized avatar

Neoteric Design, Inc. neotericdesign

View GitHub Profile
@neotericdesign
neotericdesign / gist:22dd03a4770843006c8f
Created July 18, 2014 20:43
Selectively display Postach.io tags not in a list called skiptags
{% if post.tags %}
<ul class="post-tags">
{% for tag in post.tags %}
{% if tag not in skiptags %}
<li><a href="/tag/{{ tag }}">{{ tag }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
@neotericdesign
neotericdesign / gist:4c10cc69f3b2a6312fa2
Created July 18, 2014 20:34
Define a list of tags for Postachio to skip
{% set skiptags = ['bananas', 'apples', 'status:finaldraft'] %}
koret_development=# select surveys.id, surveys.title,count(*) as count from surveys, survey_sessions, users where survey_sessions.completed_at is not null and users.id = survey_sessions.user_id and survey_sessions.survey_id = surveys.id group by surveys.id order by count;
(END)
id | title | count
----+---------------------------------------------------------------------------------------------------------------------------------------+-------
17 | Additional surveys will be added here | 5
22 | TEST YOUR KNOWLEDGE - Feline Sanitation | 22
11 | Performing Health Exams | 34
2
1
2
1
2
11
6
1
8
1
class State < ActiveRecord::Base
has_many :case_type_states
has_many :case_types, :through => :case_type_states
has_many :process_types, :through => :case_type_states
def case_type_processes=(hash)
hash.each do |case_type_id, process_type_ids|
case_type_states.create!(:case_type_id => case_type_id,
:process_type_ids => process_type_ids)
end
require 'active_record'
unless defined?(Page)
class Page < ActiveRecord::Base; end
end
unless defined?(ApplicationController)
class ApplicationController; end
end
def next
page = self.class.choose(self, 'rgt >', :first)
page ||= self.class.choose(self, 'lft <', :first)
end
def prev
page = self.class.choose(self, 'lft <', :last)
page ||= self.class.choose(self, 'rgt >', :last)
end
class CanonicalRedirect
def initialize(app)
@app = app
end
def call(env)
request = Rack::Request.new(env)
#
#
#
module NavigationHelpers
module Refinery
module Authentication
def path_to(page_name)
case page_name
when /the signup page/
signup_path
else
<feed>
<entry>
<title>The Artwork Title</title>
<author>
<name>First Name & Last Name</name>
<email>[email protected]</email>
<website>http://www.hello.com</website>
<location>Chicago, IL</location>
</author>
<vice>Hookers</vice>