Skip to content

Instantly share code, notes, and snippets.

View dergachev's full-sized avatar

Alex Dergachev dergachev

View GitHub Profile
@dergachev
dergachev / sass.md
Last active October 19, 2015 22:07 — forked from jorgediazgutierrez/sass.md
How SaSS and Bourbon Neat can help those websites running behind

How SaSS and Bourbon Neat can help those websites running behind

It's 2015, we are already in the "Mobile Era" and we all love how our modern sites fit and adapt to any screen. Of course, modern sites: pretty nice and flexible, stretching even to the 52 inches of a Samsung TV, High Resolution images... Its is just amazing. But you know what? We cannot forget there are almost 20 years of "non-mobile" websites out there, screaming to be upgraded. And the first word that comes out to our mind is pretty simple: "redesign".

Redesign means Higher Cost

Mobile OS manufacturers trend to improve their browsers to allow resizing, double tap zooming and dragging around, but it is just an actual usability workaround. It is like going to a disco that has mandatory night vision goggles to get in because it didn't had lighting setup when buil(weird huh?). You will end up in the floor, hating both: the goggles and the disco. You but you will still want to dance, so bye bye "Goggle Disco" and you'll go for a new one.

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">
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 }
@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

First create a Vagrantfile:

vagrant init precise64

Then add the following to the new Vagrantfile:

config.vm.provision :shell, :inline => <<-EOT

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:

# 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
@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: