Skip to content

Instantly share code, notes, and snippets.

@sproutventure
sproutventure / gist:5245
Created August 13, 2008 15:33
ShareThis code to change ShareThis image
========================
HEADER CODE
========================
<script type="text/javascript" src="http://w.sharethis.com/widget/?tabs=email%2Cweb&amp;charset=utf-8&amp;services=facebook%2Cmyspace%2Cdelicious%2Cstumbleupon%2Cgoogle_bmarks%2Cyahoo_bmarks%2Cyahoo_myweb%2Cwindows_live%2Cfriendfeed%2Creddit&amp;style=default&amp;publisher=cd3fa0ae-1fcf-48eb-9e10-509b3e3977f5&amp;headerbg=%23ee3a43&amp;inactivebg=%23c41230&amp;inactivefg=%23ffffff&amp;linkfg=%23474847;button=false"></script>
<script language="javascript" type="text/javascript">
var object = SHARETHIS.addEntry({
url: document.location + '?cmpid=sharethis',
title:'share',
#Crontab runs this every ten minutes (root)
*/10 * * * * /root/scripts/redmine-rake.sh > /tmp/redmine-email.log 2>&1
#this is the script
#!/bin/bash
export PATH=$PATH:/usr/local/rubygems/bin:/usr/local/rubygems/gems/bin
export RUBYLIB=/usr/local/rubygems/lib
export GEM_HOME=/usr/local/rubygems/gems
cd /var/www/vhosts/scatter3d.com/subdomains/redmine/httpdocs
RAILS_ENV="production" rake redmine:email:receive_imap port=993 host=imap.gmail.com username=redmine@sproutventure.com password=redmine42 ssl=1
@sproutventure
sproutventure / gist:43534
Created January 5, 2009 20:36
WP Author Page based on userextra filer
<?php // display all users with usermeta 'featured_author' checked 'yes'
global $wpdb, $usermeta;
$featured_authors = $wpdb->get_results("
SELECT user.ID, user.user_nicename
FROM $wpdb->users user
", OBJECT);
// loop through authors
foreach($featured_authors as $featured_author) {
$curauthor = get_userdata( $featured_author->ID );
// select featured authors
Processing ApplicationController#index (for XXX at 2009-01-07 11:46:00) [GET]
Session ID: XXX
Parameters: {}
ActionController::RoutingError (No route matches "/error_docs/bad_gateway.html" with {:method=>:get}):
/usr/local/rubygems/gems/gems/actionpack-2.1.2/lib/action_controller/routing/recognition_optimisation.rb:67:in `recognize_path'
/usr/local/rubygems/gems/gems/actionpack-2.1.2/lib/action_controller/routing/route_set.rb:385:in `recognize'
/usr/local/rubygems/gems/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:148:in `handle_request'
/usr/local/rubygems/gems/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:107:in `dispatch'
@sproutventure
sproutventure / gist:44466
Created January 7, 2009 21:57
Redmine/Rails email through Gmail SMTP
require "openssl"
require "net/smtp"
Net::SMTP.class_eval do
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
check_auth_args user, secret if user or secret
sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
<ul id="pagenav">
<li class="<?php if ( is_home() ) { echo 'current_page_item'; } ?>"><a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>">Home</a></li>
<?php wp_list_pages('sort_column=menu_order&title_li=&exclude=1'); ?>
</ul>
@sproutventure
sproutventure / gist:172954
Created August 22, 2009 19:35
WP template for redirecting.
<?php
/*
Template name: [Redirect]
// Create a Meta Field named "Redirect" and the value would be the resulting redirect.
*/
?>
<?php wp_head(); ?>
/*
...
------------------------------------ Style Index-----------------------------------------------
All Structural Changes @group Structure Changes
All Style and Type Changes @group Style and Typography
<?php
/**
* @package Twittar - Twitter Avatar for Wordpress
* @author Ricardo Sousa - SmashingMagazine
* @version 1.0
*/
/*
Plugin Name: Twittar
Plugin URI: http://smashingmagazine.com
Description: This is a simple but yet powerful plugin for wordpress that lets you show your users Twitter avatar together with their comments in your website. This is done by matching their mail adress with their twitter account. Works only in public Twitter accounts. Depending of the version if the user has no avatar it will show a default picture that come along with this plugin or gravatar instead.
register_sidebar(array('name'=>'Default Sidebar', 'cols'=>1) + $p );
register_sidebar(array('name'=>'Default Inline 2col', 'cols'=>2) + $p );
register_sidebar(array('name'=>'Home Footer 1 2col', 'cols'=>2) + $p );
register_sidebar(array('name'=>'Home Footer 2 2col', 'cols'=>2) + $p );
register_sidebar(array('name'=>'Home Footer 3 2col', 'cols'=>2) + $p );
register_sidebar(array('name'=>'Home Sidebar', 'cols'=>1) + $p );
register_sidebar(array('name'=>'Home Inline 2col', 'cols'=>2) + $p );
register_sidebar(array('name'=>'Post Sidebar', 'cols'=>1) + $p );
register_sidebar(array('name'=>'Page Sidebar', 'cols'=>1) + $p );
register_sidebar(array('name'=>'Topic Sidebar', 'cols'=>1) + $p );