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
<?php function list_articles(){ | |
global $month, $wpdb, $wp_version; | |
$now = current_time('mysql'); | |
if(version_compare($wp_version, '2.1', '<')){$current_posts = "post_date < '$now'";} else {$current_posts = "post_type='post'";} | |
$arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM " . $wpdb->posts . " WHERE post_status='publish' AND $current_posts AND post_password='' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC"); | |
if($arcresults){ | |
foreach($arcresults as $arcresult) { | |
$url = get_month_link($arcresult->year, $arcresult->month); |
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
javascript:void(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;i%3Ca.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')%3E=0&&s.href)%20{var%20h=s.href.replace(/(&|%5C?)forceReload=\d+/,'');s.href=h+(h.indexOf('?')%3E=0?'&':'?')+'forceReload='+(new%20Date().valueOf())}}})(); |
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
Aurora:skribit Paul$ script/generate twitter_auth | |
done loading services | |
The name 'User' is either already used in your application or reserved by Ruby on Rails. | |
Please choose an alternative and run this generator again. | |
Suggestions: | |
exploiter | |
drug user | |
substance abuser |
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
class ActsAsTaggableOnMigration < ActiveRecord::Migration | |
def self.up | |
change_table :taggings do |t| | |
t.column :tagger_id, :integer | |
t.column :tagger_type, :string | |
t.column :context, :string | |
end | |
add_index :taggings, :context | |
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
SELECT count(DISTINCT blogs.*) AS count_distinct_blogs_all FROM `blogs` LEFT OUTER JOIN taggings blogs_taggings ON blogs_taggings.taggable_id = blogs.id AND blogs_taggings.taggable_type = 'Blog' LEFT OUTER JOIN tags blogs_tags ON blogs_tags.id = blogs_taggings.tag_id WHERE (context = 'tags' AND blogs_tags.name LIKE 'Technology') ORDER BY created_at DESC LIMIT 0, 15 |
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
namespace :db do | |
desc "abort rake if using bad memory techniques" | |
task :safety_migrate => :environment do | |
path = "#{RAILS_ROOT}/db/migrate/" | |
migration_directory = Dir.new(path) | |
proceed = true | |
migration_directory.each do |file| | |
if file != "." and file != ".." | |
migration = File.open("#{path}#{file}") | |
text = migration.read |
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
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer! | |
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ " | |
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty! | |
# ~/code/web:beta_directory$ git checkout master | |
# Switched to branch "master" | |
# ~/code/web:master$ git checkout beta_directory | |
# Switched to branch "beta_directory" |
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
require 'open-uri' | |
# url dsl -- the ultimate url dsl! | |
# | |
# You just can't beat this: | |
# | |
# $ irb -r url_dsl | |
# >> include URLDSL | |
# => Object | |
# >> http://github.com/defunkt.json |
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
@danielbru | |
@dougaitken | |
@theiBlog | |
@mike_wilt | |
@duncanfreeman | |
@sanjay | |
@Michaelmontano | |
@GoKTGo | |
@colinake | |
@lessallan |
OlderNewer