Skip to content

Instantly share code, notes, and snippets.

View jeffsebring's full-sized avatar

Jeff Sebring jeffsebring

  • Spokane, Washington USA
View GitHub Profile
@jeffsebring
jeffsebring / favorite-tweets-widget
Created January 23, 2012 20:01 — forked from norcross/favorite-tweets-widget
Favorite Tweets widget
// favorite tweets
class rkv_fav_tweets extends WP_Widget {
function rkv_fav_tweets() {
$widget_ops = array( 'classname' => 'fav_tweets', 'description' => 'Displays tweets favorited by a user' );
$this->WP_Widget( 'fav_tweets', 'Favorite Tweets', $widget_ops );
}
function widget( $args, $instance ) {
extract( $args, EXTR_SKIP );
@jeffsebring
jeffsebring / googlecdninfooter
Created January 31, 2012 05:58
Google CDN in Footer
# Google jQuery
wp_deregister_script( 'jquery' );
wp_register_script(
'jquery',
'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js',
'',
'',
true # in footer
);
wp_enqueue_script( 'jquery' );
@jeffsebring
jeffsebring / gist:1842655
Created February 16, 2012 06:28
Ubuntu 11.10 install ROR
sudo apt-get install unzip curl aptitude
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
source ~/.profile
#rvm tools rvm-env ruby bash
# if .bashrc is exist, copy rvm init script in .bashrc
sudo apt-get update
@jeffsebring
jeffsebring / taxonomy-feeds.php
Created February 25, 2012 09:19 — forked from hakre/taxonomy-feeds.php
WordPress 3.1 Taxonomy Feeds
<?php
/**
* WordPress 3.1 Taxonomy Feeds Plugin (Must-Use)
*
* Copyright (C) 2011 hakre <http://hakre.wordpress.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
@jeffsebring
jeffsebring / gist:2025998
Created March 13, 2012 01:19 — forked from Viper007Bond/gist:2025993
Graphing car mileage
<?php
/**
* All of this code is in a big class that implements things like meta boxes and
* tons of other stuff but for now here's the relevant functions.
*
* Note the custom post types and custom taxonomies are just in placeholder form.
* I haven't gone through and properly set the labels, etc. for them like I will
* when I release the plugin.
*/
@jeffsebring
jeffsebring / example.php
Created March 21, 2012 22:27 — forked from jonathonbyrdziak/example.php
Wordpress Metabox, stand alone class for multiple metabox abilities
<?php
/*
Here's a couple of metaboxes that I've recently created using this system
*/
$subpostings = redrokk_metabox_class::getInstance('subpostings', array(
'title' => '(optional) Subscription for Postings',
'description' => "As an optional feature, you have a complete api at your disposal which will allow you the ability to offer and manage member posts. In addition to these settings, you may need to create the associated pages for accepting posts from your frontend.",
@jeffsebring
jeffsebring / nginx_no_www
Created March 26, 2012 16:11
nginx remove www redirect
server {
server_name www.example.com;
rewrite ^/(.*)$ http://example.com/$1 permanent;
}
@jeffsebring
jeffsebring / modernizr_nested.scss
Created April 1, 2012 04:14
Nested Modernizr Classes with Compass
.textshadow {
.widget h3 {
text-shadow: -1px -1px 0 #aaa, 2px 2px 5px #3a3a3a;
}
}
@jeffsebring
jeffsebring / wordpress_admin_bar_menu.php
Created April 1, 2012 05:58
WordPress Admin Bar Menu Example
add_action('admin_bar_menu', 'webmaster_admin_bar_menu', 99);
function webmaster_admin_bar_menu() {
global $wp_admin_bar;
$menus[] = array(
'id' => 'webmaster',
'title' => 'Web Master',
'href' => 'http://yourdomain.com/',
'meta' => array(
@jeffsebring
jeffsebring / wp_permalinks.nginx
Created April 3, 2012 22:03
WordPress NGINX Permalink rewrites