This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(/** | |
* Flotr Defaults | |
*/ | |
Flotr.defaultOptions = { | |
colors: ['#00A8F0', '#C0D800', '#CB4B4B', '#4DA74D', '#9440ED'], //=> The default colorscheme. When there are > 5 series, additional colors are generated. | |
ieBackgroundColor: '#FFFFFF', // Background color for excanvas clipping | |
title: null, // => The graph's title | |
subtitle: null, // => The graph's subtitle | |
shadowSize: 4, // => size of the 'fake' shadow | |
defaultType: null, // => default series type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FieldUpdate.where("created_at < ?", Date.today) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## PayRoll Application Gem | |
# lib/pay_roll/pay_day_service.rb | |
# Consider this Use Case as the Context in DCI | |
# | |
class PayRoll::PayDayService | |
def initialize(date=Date.today) | |
@date = date | |
# Employee could be any data source from the host, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_validation :slug_to_slug | |
protected | |
def slug_to_slug | |
self.slug = self.to_slug | |
end | |
def to_slug(param=self.slug) | |
# strip the string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://blog.wyeworks.com/2009/7/13/paperclip-file-rename | |
Paperclip.interpolates :default_image_type do |attachment, style| | |
attachment.instance.get_user_default_profile_image | |
end | |
Paperclip.interpolates :normalized_avatar_file_name do |attachment, style| | |
attachment.instance.normalized_avatar_file_name | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd VimEnter * NERDTree | |
autocmd VimEnter * wincmd p | |
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" => General | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Sets how many lines of history VIM has to remember | |
set history=700 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# definition | |
# provide an optional day name (in English) | |
# as the last parameter to get the number of times that day occurs | |
# between the two provided dates | |
# | |
# dates (t1 and t2) should be valid Time object dates | |
def list_days_between(t1, t2, day_name=nil) | |
days = [] | |
(t2.to_i..t1.to_i).step(86400) do |t| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$default_rounded_amount: 5px | |
// Round corner at position by amount. | |
@mixin round-corner($position, $amount: $default_rounded_amount) | |
border-#{$position}-radius: $amount | |
-webkit-border-#{$position}-radius: $amount | |
@mixin round-corner-mozilla($position, $amount: $default_rounded_amount) | |
-moz-border-radius-#{$position}: $amount | |
// Round left corners by amount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.flash=[:error, :warning, :notice].map { |type| flash_tag(type, :id => "flash_#{type}") }.join |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#flash_notice, #flash_alert, #flash_error { | |
z-index: 999; | |
border-radius: 10px; | |
-moz-border-radius: 10px; | |
-webkit-border-radius: 10px; | |
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); | |
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); | |
-webkit-box-shadow: 0 0 40px rgba(0, 0, 0, 0.5); | |
position: absolute; | |
right: 20px; |