Skip to content

Instantly share code, notes, and snippets.

View dergachev's full-sized avatar

Alex Dergachev dergachev

View GitHub Profile
@dergachev
dergachev / index.html
Created December 17, 2012 21:12 — forked from anonymous/scratchpad.js
Source code from scratchpad.io
<!DOCTYPE html>
<html lang="en">
<head>
<!-- added by alex dergachev -->
<base href="http://scratchpad.io/">
<title>Scratchpad</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body id="scratchpad" tabindex="0">
@dergachev
dergachev / README.md
Last active December 17, 2023 22:07 — forked from anonymous/bookmarklet.js
rule-of-thirds bookmarklet

rule-of-thirds bookmarklet that overlays a rule-of-thirds style grid over all images on a page.

To get the bookmarklet, visit http://bl.ocks.org/4331769

Bookmarklet Development Notes

Do the following to be able to use the "RuleOfThirds-localhost" development version of the bookmarklet:

# Place this file in the same directory as `Vagrantfile'
# then simply require "vagrant-snapshot.rb" at the top of Vagrantfile.
require 'optparse'
Vagrant.commands.register(:snap) { Snap::Commands }
# Provide rake-like desc() 'inflected' documentation
# See http://stackoverflow.com/questions/2948328/access-attributes-methods-comments-programmatically-in-ruby
class Module

vagrant-drupal repo structure

We're exploring alternative layouts for the vagrant-drupal repo structure.

Idea 1: project sub-repo

Assuming we want to keep Vagrantfile and Berksfile in git, and assuming that we have an existing Drupal project repo, the layout will be as follows:

First create a Vagrantfile:

vagrant init precise64

Then add the following to the new Vagrantfile:

config.vm.provision :shell, :inline => <<-EOT
@dergachev
dergachev / pdf2jpg.sh
Created November 26, 2013 01:51 — forked from yura/pdf2jpg.sh
#!/bin/bash
# Script to convert PDF file to JPG images
#
# Dependencies:
# * pdftk
# * imagemagick
PDF=$1
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index b381fbc..b4a4aad 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -132,7 +132,7 @@ class MyController < ApplicationController
@user = User.current
layout = @user.pref[:my_page_layout] || {}
# remove if already present in a group
- %w(top left right).each {|f| (layout[f] ||= []).delete block }
+ %w(top left right bottom).each {|f| (layout[f] ||= []).delete block }
diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml
index cfe0288..b8fffa0 100644
--- a/app/views/issues/show.rhtml
+++ b/app/views/issues/show.rhtml
@@ -25,11 +25,29 @@
<th class="due-date"><%=l(:field_due_date)%>:</th><td class="due-date"><%= format_date(@issue.due_date) %></td>
</tr>
<tr>
- <th class="assigned-to"><%=l(:field_assigned_to)%>:</th><td class="assigned-to"><%= avatar(@issue.assigned_to, :size => "14") %><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
+ <th class="assigned-to"><%=l(:field_assigned_to)%>:</th><td class="assigned-to">