Skip to content

Instantly share code, notes, and snippets.

@kaievns
kaievns / gist:1497611
Created December 19, 2011 15:11
Gradient Buttons The Right Way
// This way you can change the buttons color with a simple `background-color` setting
// without need to regenerate the whole gradient
input[type=button], input[type=submit], button
font-family: Arial, Helvetica
color: #333
border: 1px solid #ccc
border-radius: .25em
text-shadow: 0 1px 1px rgba(0,0,0,.3)
@kaievns
kaievns / gist:1509909
Created December 22, 2011 10:54
CSS3 Links without icons
a.add, a.edit, a.delete
&:before
margin-right: .25em
a.add:before
content: "\271A"
a.edit:before
content: "\270E"
data: function() {
return {
trend : this.model.trend,
subtrend : this.model,
next_subtrend : this.model.nextSubtrend(),
next_trend : this.model.trend.nextTrend()
};
}
@kaievns
kaievns / gist:3158011
Created July 22, 2012 02:38
Paperclip mongoid support that works with mongoid 3
#
# Save this into your `lib/mongoid/paperclip.rb` file
#
#
require "paperclip"
module Paperclip
class << self
@kaievns
kaievns / gist:6228359
Created August 14, 2013 05:53
How to enable nested `feature` constructions in the `rspec` features
#
# Put this somwehere in your `spec/support` folder, then you can do something like that
#
# feature "Stuff" do
# feature 'new' do
# scenario 'user goes in and gets awesomized' do
# end
#
# scenario 'user goes in with evil intentions and doesn't get awesomized' do
# end
@kaievns
kaievns / gist:7701961
Created November 29, 2013 05:30
Brutus on the walk
require 'curses'
class Engine
def self.inst
@inst
end
def self.inst=(inst)
@inst = inst
@kaievns
kaievns / Procfile
Created January 16, 2014 00:41
Makes zeus to run all your ruby processes through a Procfile
zeus: echo "Spawining Zeus..." && zeus start &> /dev/null
resque1: sleep 2 && zeus rake resque:work RAILS_ENV=development COUNT=1 QUEUE=*
resque2: sleep 2 && zeus rake resque:work RAILS_ENV=development COUNT=1 QUEUE=*
resque3: sleep 2 && zeus rake resque:work RAILS_ENV=development COUNT=1 QUEUE=*
web: sleep 2 && zeus server
guard 'livereload' do
watch(%r{app/views/.+\.(erb|haml|slim)$})
watch(%r{app/helpers/.+\.rb})
watch(%r{public/.+\.(css|js|html)})
watch(%r{config/locales/.+\.yml})
# Rails Assets Pipeline
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|coffee|less|html|png|jpg|hbs|emblem))).*}) { |m| "/assets/#{m[3]}" }
end
class ApplicationController
before_fitler :autfind_stuff
def self.autofinders
@autofinders ||= []
end
def self.autofind(param, &block)
autofinders << [param, block]
end
@kaievns
kaievns / gist:88bfb69f5acf6a340461
Created May 11, 2014 03:58
Less annoying cursor for atomio
.editor.is-focused {
.cursor {
transition: opacity .25s ease-in-out;
opacity: 0.7;
background: gray;
border: none;
&.blink-off {
visibility: visible;
opacity: 0.2;