Skip to content

Instantly share code, notes, and snippets.

Started GET "/" for ::ffff:80.203.58.233 at 2014-10-17 17:29:33 +0000
ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by Forem::ForumsController#index as HTML
Forem::Category Load (0.3ms) SELECT "forem_categories".* FROM "forem_categories"
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
Forem::Forum Load (0.3ms) SELECT "forem_forums".* FROM "forem_forums" WHERE "forem_forums"."category_id" = ? ORDER BY "forem_forums"."name" ASC [["category_id", 1]]
Forem::Category Load (0.2ms) SELECT "forem_categories".* FROM "forem_categories" WHERE "forem_categories"."id" = ? LIMIT 1 [["id", 1]]
Forem::Post Load (0.4ms) SELECT "forem_posts".* FROM "forem_posts" INNER JOIN "forem_topics" ON "forem_posts"."topic_id" = "forem_topics"."id" WHERE "forem_topics"."forum_id" = ? ORDER B
Started GET "/" for ::ffff:80.203.58.233 at 2014-10-17 17:29:33 +0000
ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by Forem::ForumsController#index as HTML
Forem::Category Load (0.3ms) SELECT "forem_categories".* FROM "forem_categories"
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
Forem::Forum Load (0.3ms) SELECT "forem_forums".* FROM "forem_forums" WHERE "forem_forums"."category_id" = ? ORDER BY "forem_forums"."name" ASC [["category_id", 1]]
Forem::Category Load (0.2ms) SELECT "forem_categories".* FROM "forem_categories" WHERE "forem_categories"."id" = ? LIMIT 1 [["id", 1]]
Forem::Post Load (0.4ms) SELECT "forem_posts".* FROM "forem_posts" INNER JOIN "forem_topics" ON "forem_posts"."topic_id" = "forem_topics"."id" WHERE "forem_topics"."forum_id" = ? ORDER B
Started GET "/" for ::ffff:80.203.58.233 at 2014-10-17 17:03:27 +0000
ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by Forem::ForumsController#index as HTML
Forem::Category Load (0.3ms) SELECT "forem_categories".* FROM "forem_categories"
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
Forem::Forum Load (0.3ms) SELECT "forem_forums".* FROM "forem_forums" WHERE "forem_forums"."category_id" = ? ORDER BY "forem_forums"."name" ASC [["category_id", 1]]
Forem::Category Load (0.3ms) SELECT "forem_categories".* FROM "forem_categories" WHERE "forem_categories"."id" = ? LIMIT 1 [["id", 1]]
Forem::Post Load (0.4ms) SELECT "forem_posts".* FROM "forem_posts" INNER JOIN "forem_topics" ON "forem_posts"."topic_id" = "forem_topics"."id" WHERE "forem_topics"."forum_id" = ? ORDER B
@frankie-loves-jesus
frankie-loves-jesus / 1 - Test.md
Last active August 29, 2015 14:07
Forem with Paperclip

i18n-js combined with rails-i18n causes mass-export of all available languages into JS file

Gemfile

gem 'rails-i18n'
gem 'i18n-js'

config/i18n-js.yml

Rails static page made up of multiple jQuery Mobile pages

How do I do a Rails static page made up of multiple jQuery Mobile pages when this static page is already inside a jQuery Mobile page?

app/views/layouts/application.html.erb

<!doctype html>
<html>
  <head>
    <title>My App</title>
def add_emojify_and_kramdown(text)
raw(Kramdown::Document.new(emojify(text)).to_html)
end
[...snip...]
def emojify(text)
h(text).to_str.gsub(/:([a-z0-9\+\-_]+):/) do |match|
if emoji = Emoji.find_by_alias($1)
@frankie-loves-jesus
frankie-loves-jesus / 0 - Intro.md
Last active August 29, 2015 14:05
Tor blocker

jQuery Mobile infinite scroll + Rails app

Uses Kaminari for pagination.

Problem: Duplicated duplicated items every now and then. When going from page to page manually without the JS, there are no duplicated items.

Live app: http://runnable.com/U_Kgwes7l3URYNwa/jqm-infinite-scroll-with-rails

  1. Click Run
  2. In the following page, click the #output-popout icon in the header to open app without Runnable controls