This file contains hidden or 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
# can i do something like content.yield | |
# so i dont have to call content on each line of code? | |
def follow str | |
followers = @blog.followers | |
following = @blog.user.following_users | |
iterate_on_block str, followers, :Followers do |content,follower| | |
content.t_replace :FollowBlogName, follower.blog_name | |
content.t_replace :FollowProfileImage, follower.profile_image |
This file contains hidden or 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
$("#new-frame").load(function(){ | |
$(this).load(function(){self.location.reload(true);}); | |
}); |
This file contains hidden or 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="info-box"> | |
<div class="top-middle"> | |
<div class="top"> | |
<h2>Settings</h2> | |
<ul id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> | |
<li> <a href="#blog-settings">Blog Settings</a></li> | |
<li> <a href="#my-info">My Info</a></li> | |
<li> <a href="#theme">Theme</a></li> | |
</ul> | |
</div> |
This file contains hidden or 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
$('.unfollow-button').live('click',function(e){ | |
var uid = this.id.match(/fol-(\d+)/)[1]; | |
var button = this; | |
$.post("/unfollow/"+uid+"?ajax",{},function(data){ | |
$(button).removeClass('.unfollow-button').addClass('.follow-button'); | |
},'json'); | |
return false; | |
}); |
This file contains hidden or 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
selector | |
background-position = -3*!width -0*!height | |
&:hover | |
background-position = -3*!width -1*!height | |
&:active | |
background-position = -3*!width -2*!height |
This file contains hidden or 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
klass.replace_block(:matcher,[array,of,values]) do |scoped_klass,individual_value| | |
scoped_klass.my_method :foo, individual_value | |
end |
This file contains hidden or 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
require 'yaml' | |
module UserAgentFetures | |
class UserAgent | |
attr_accessor :string | |
yamlfile = File.join(File.dirname(__FILE__),'features.yaml') | |
features = YAML::load(File.open(yamlfile)) | |
aliases = [] | |
features.each do |feature,compatability| |
This file contains hidden or 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
#! /usr/bin/perl -w | |
# | |
# $Id: api.example.flush.txt 21976 2009-11-10 17:43:53Z ivanhoven $ | |
# | |
# This is an example of using Panther Web Services APIs to flush | |
# objects from cache. Usage of the script is as follows: | |
# | |
# 1. Rename this example file to flush.pl and enable the execute bit. | |
# | |
# 2. Execute the script: |
This file contains hidden or 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
File.open(file_path).inject([]) do |result,line| | |
unless start_reading | |
start_reading =~ /ClosureCompiler/i | |
next result | |
end | |
break result if line =~ /\/ClosureCompiler/i | |
logic | |
This file contains hidden or 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
class InfoCount < Sequel::Model | |
unrestrict_primary_key | |
class << self | |
def [](*args) | |
ret = super(*args) | |
if args.size == 1 && !ret && args.first | |
ret = create(:user_id => args.first) | |
end | |
ret |
OlderNewer