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
<html_code><![CDATA[<a href="http://example.com" target="_blank"><img src="http://kozgun.net/images/screenshots/0000/0025/sopar-0.1-800_thumb.png" hspace="0" vspace="0" border="0" id="htmlbannerinstance"/></a>]]></html_code> |
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
SplashScreen.blueprint do | |
image { File.open(File.join(Rails.root, "features", "assets", "images", "splash_screen.jpg")) } | |
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
module ActiveRecord | |
module ModelSchema | |
module ClassMethods | |
def compute_table_name | |
base = base_class | |
if self == Globalize::ActiveRecord::Translation #globalize3 | |
tbl_name = "translations" | |
elsif superclass == Globalize::ActiveRecord::Translation #globalize3 | |
tbl_name = "#{self.parent.table_name.singularize}_translations" | |
elsif self == base |
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
mode: "textareas" | |
theme: "advanced" | |
#skin: "o2k7" | |
#skin_variant: "silver" | |
editor_selector: "mceEditor" | |
language: "tr" | |
#content_css : "/stylesheets/tinymce.css" | |
plugins: | |
- inlinepopups | |
- preview |
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://www.broadcastingadam.com/2012/07/advanced_caching_part_2-using_strategies/ | |
# Step 3: Caching Views Generated from Arrays | |
# missing "}" | |
class Post | |
def cache_key | |
Digest::MD5.hexdigest "#{maximum(:updated_at).try(:to_i)}-#{count}" | |
end | |
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
# Not so good: | |
def street_name(user) | |
if user.address | |
user.address.street_name | |
else | |
'No street name on file' | |
end | |
end | |
# Better: |
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
INSERT INTO languages(code, locale, direction) VALUES ('GB', 'gb', 'ltr'), ('US', 'us', 'ltr'), ('AU', 'au', 'ltr'); |
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
$(document).ready(function() { | |
var d = new Date(); | |
var search_timer = d.getTime(); | |
var time_range = 1000; | |
$('#site_search_q2').live('keyup', function(event){ | |
if ($(this).val().length > 2) { | |
var d2 = new Date(); | |
var new_search_time = d2.getTime(); |
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
<div class="urunler"> | |
<div data-puan="3">...</div> | |
<div data-puan="3">...</div> | |
<div data-puan="5">...</div> | |
<div data-puan="15">...</div> | |
<div data-puan="650">...</div> | |
</div> |
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
var tumPuanlarTmp = []; | |
var tumPuanlar = []; | |
$('div.urunler div').each(function(idx, el) { | |
tumPuanlar.push(parseInt($(el).attr('data-puan'))); | |
}); | |
tumPuanlar = jQuery.unique(tumPuanlar); | |
tumPuanlar = tumPuanlar.sort(function(a,b){return a-b}); | |