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
| #@me variable is like current_user | |
| <% alert_list = Alert.list(@me, 5) %> | |
| <!-- Alerts --> | |
| <div id="alerts" class="module"> | |
| <div class="module_head"> | |
| <h3 class="module_name">Alerts and Notifications</h3> | |
| <ul class="module_options cx"> | |
| <li><%= link_to(_('View All'), :controller => 'alert', :action => 'list') if not alert_list.empty? %></li> | |
| <li><%= link_to(_('Preferences'), :controller => 'user', :action => 'settings', :anchor => 'alerts') %></li> | |
| </ul> |
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
| <opml version="1.0"> | |
| − | |
| <head> | |
| <title>Srdjan subscriptions in Google Reader</title> | |
| </head> | |
| − | |
| <body> | |
| − | |
| <outline title="Javascript" text="Javascript"> | |
| <outline text="Douglas Crockford's The Department of Style" title="Douglas Crockford's The Department of Style" type="rss" xmlUrl="http://blog.360.yahoo.com/rss-TBPekxc1dLNy5DOloPfzVvFIVOWMB0li" htmlUrl="http://blog.360.yahoo.com/blog-TBPekxc1dLNy5DOloPfzVvFIVOWMB0li"/> |
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
| function addLoadEvent(func) | |
| { | |
| var oldonload = window.onload; | |
| if(typeof window.onload != 'function') | |
| { | |
| window.onload = func; | |
| } | |
| else | |
| { | |
| window.onload = function() |
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
| Private Function RemoveEmptyRows(ByVal dt As DataTable) As DataTable | |
| Dim rowIndexes As New ArrayList | |
| Dim changed As New DataTable | |
| dt.AcceptChanges() | |
| For i As Integer = 0 To dt.Rows.Count - 1 | |
| If dt.Rows(i).Item(2).ToString = String.Empty Then | |
| rowIndexes.Add(i) | |
| End If | |
| Next | |
| For Each index As Integer In rowIndexes |
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 CommentsController < ApplicationController | |
| before_filter :find_post | |
| skip_before_filter :check_login | |
| def create | |
| @comment = @post.comments.new | |
| @comment.body = params[:comment][:body] | |
| @comment.user_directory_id = @me.user_directory_id | |
| respond_to do |format| |
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 id="posts" class="module"> | |
| <div class="module_head"> | |
| <h3 class="module_name"><%= link_to post.title, user_post_path(user,post) %></h3> | |
| <% if @me == @user -%> | |
| <ul class="module_options cx"> | |
| <li><%= link_to 'Edit', edit_user_post_path(user, post) %></li> | |
| <li><%= link_to 'Delete', user_post_path(user, post), :method => 'delete', :confirm => 'Are you sure?' %></li> | |
| </ul> | |
| <% end -%> | |
| </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
| class User < ActiveRecord::Base | |
| # Blog related | |
| def last_posts(published_only = false, limit = MAX_BLOG_ENTRIES) | |
| conditions = nil | |
| conditions = 'draft=false' if published_only | |
| self.posts.find(:all, :select => 'id, title, preview, draft, created_at', | |
| :conditions => conditions, :limit => limit, | |
| :order => "created_at DESC") | |
| 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
| class SomeClass | |
| class << self | |
| def hooks | |
| @hooks ||= Hash.new([]) | |
| end | |
| def add_hook(kind, &block) | |
| self.hooks[kind] << block | |
| 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
| #!/bin/sh | |
| mkdir -p /usr/local/src && cd /usr/local/src | |
| wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.bz2 | |
| tar -xjvf ruby-1.9.1-p0.tar.bz2 | |
| cd ruby-1.9.1-p0 | |
| ./configure --prefix=/usr --program-suffix=19 --enable-shared | |
| make && make install |
OlderNewer