Skip to content

Instantly share code, notes, and snippets.

// Från http://jardenberg.se/b/morgonkommentarerna-nu-lite-nyttigare/
jQuery(document).ready(function() {
// Hämta ankare från URL
var thishash = document.location.hash.substring(1);
if (thishash.length && !isNaN(thishash)) {
// Ankare har kommit in och det är numeriskt
// Traversera alla "li" inom "ol" inom "#content"
var thisli = jQuery('#content ol li').each(function(index) {;
@standout
standout / post.rb
Created August 13, 2009 12:56
Super simple spam protection for Ruby on Rails
class Post < ActiveRecord::Base
attr_accessor :comment # fake attribute used for spam trapping
validates_length_of :comment, :in => 0..1
end
# Make sure we have the correct permissions on everything
task :after_symlink, :roles => :app do
run "chmod -R 755 #{current_path}/tmp"
run "chown -R www-data:www-data #{current_path}/"
run "chown -R www-data:www-data #{shared_path}/"
end