Skip to content

Instantly share code, notes, and snippets.

@methyl
methyl / _sidebar.html.erb
Created February 10, 2013 21:35
HTML: side bar
<nav id="by_time">
<ul>
<li><%= link_to t('refinery.plugins.events.soon'), refinery.soon_events_path %></li>
<li><%= link_to t('refinery.plugins.events.today'), refinery.today_events_path %></li>
<li><%= link_to t('refinery.plugins.events.archive'), refinery.archive_events_path %></li>
</ul>
</nav>
@methyl
methyl / img to image_tag regexp
Last active December 15, 2015 00:58
Regular expression for changing img to image_tag
<img src="images\/(.*.jpg)" width="(\d*)" height="(\d*)" alt="(.*)">
<%= image_tag '$1', size: '$2x$3', alt: '$4' %>
From d02dd19687fef34e31813139ba81f355d8fdfac5 Mon Sep 17 00:00:00 2001
From: Jan Dudek <jd@jandudek.com>
Date: Sun, 5 May 2013 21:27:26 +0200
Subject: [PATCH 01/21] Fixed incorrect namespaces, moved files in wrong
locations, added explicit require
---
src/app.coffee | 117 ++++++
src/app/plugin/PullRefresh.js | 405 ---------------------
src/app/templates/opinionListTemplate.coffee | 17 -
diff --git a/app/assets/javascripts/new/controllers/home_page.coffee b/app/assets/javascripts/new/controllers/home_page.coffee
index a217063..ed53bc0 100644
--- a/app/assets/javascripts/new/controllers/home_page.coffee
+++ b/app/assets/javascripts/new/controllers/home_page.coffee
@@ -1,13 +1,17 @@
class SquerbWeb.controllers.HomePage
- constructor: (@router, @top, @contentRegion, @topicsController) ->
+ _.extend(@::, Backbone.Events)
+
+ constructor: (@router, @top, @contentRegion, @topicsController, @streamsController) ->
class SquerbWeb.views.Tooltip extends Backbone.View
template: HandlebarsTemplates['new/tooltip']
className: 'tooltip'
constructor: (options) ->
@$parent = options.parent
@html = options.html
super(options)
render: =>
<div data-subview="page-header" data-0="background-position:0 10px" data-end="background-position:0 300px;"></div>
<div id="content">
<div class="content">
<div data-subview="current-view" id="content"></div>
</div>
</div>
<div data-subview="page-footer" data-0="background-position:0 -300px" data-end="background-position:0 0px;"></div>
Game.select('games.*, SUM(CASE WHEN votes.weight > 0 THEN votes.weight ELSE 0 END) as positive, SUM(CASE WHEN votes.weight < 0 THEN votes.weight ELSE 0 END) as negative').joins(:votes).group('games.id')
<div style="position: fixed;width: 100px;background: #000;position: absolute;top: 0;bottom: 0;">
class GithubWebhooksController
def payload
case event
when 'push' then handle_push
when 'delete' then handle_delete
end
end
private
<div class="box center">
<img class="box-top" src="images/content-right-box-top2.png" alt=""/>
<a style="display:block; padding-top:1px" href='http://www.siepomaga.pl/' onclick='window.open(this.href);return false'><img src='http://www.siepomaga.pl/b/zmieniaj_swiat/300x50.png' alt='300x50' /></a>
<img class="box-bottom" src="images/content-right-box-bottom2.png" alt=""/>
</div>