The God's easiest way to create tab-based interface.
$(function(){
$('#example').tabit();
});
def create | |
@roll = Roll.new(params[:roll]) | |
@rolls = Roll.all(:order => "created_at DESC", :limit => 5) | |
# Creating a random id & name in case is empty | |
@number = (rand(900000)+100001) | |
@roll.id = @number | |
if @roll.name.empty? | |
@roll.name = "Roll #" + @number.to_s | |
end |
def create | |
color = params[:color] | |
color[:color].gsub!(/^(#|0x)/, '') | |
@color = Color.new(color) | |
@color.user = current_user | |
if @color.save | |
redirect_to(root_url) | |
end | |
end |
$(function(){ | |
var page = $('#page') | |
page.prepend('<i id="position" />'); | |
var position = $('#position') | |
position.hide(); | |
$('.submit-hover').hide(); | |
page.click( function(e){ | |
$('#x').val(e.pageX); | |
$('#y').val(e.pageY); | |
position.css('top', e.pageY - 15); |
class Project < ActiveRecord::Base | |
belongs_to :company | |
has_many :logs | |
validates_presence_of :name | |
def total_hours | |
total_time = 0 | |
logs.each do |l| | |
total_time += l.time.to_f |
require 'nanoc3/tasks' | |
user = "[email protected]" | |
server = "acualicio.us" | |
path = "/nfs/c05/h01/mnt/70722/users/.home/domains/acualicio.us/" | |
# message = "changed on" + Time.now.localtime.strftime("%Y-%m-%d") | |
task :sync do | |
system "rsync -vru --exclude='.DS_Store' html #{user}@#{server}:#{path}" | |
end |
h1 { | |
background: #eee -webkit-gradient(linear, | |
left 20, left 40, | |
color-stop(0, transparent), | |
color-stop(0.5, rgba(0, 0, 0, 0.33)), | |
color-stop(0.25, rgba(0, 0, 0, 0)), | |
color-stop(0.75, transparent)); | |
-webkit-background-clip: text; | |
-webkit-text-fill-color: transparent; } |
var runWhenClicked = function(){ | |
var checked = $('#fave-restaurants').find(":checked"); | |
checked.length > 0 ? $('#find-table-favorite').text('Buscar en los seleccionados') : $('#find-table-favorite').text('Buscar mesas'); } | |
$(':checkbox').click(runWhenClicked); |
@-webkit-keyframes roll-action { | |
0% { | |
-webkit-transform: scale(2); | |
opacity: 0; } | |
100% { | |
-webkit-transform: scale(1); | |
opacity: 1; } } | |
span.roll-result { | |
-webkit-animation: roll-action 0.25s; } |