Skip to content

Instantly share code, notes, and snippets.

View palimadra's full-sized avatar

Pali Madra palimadra

View GitHub Profile
@palimadra
palimadra / wordpress2tumblr.rb
Created March 25, 2012 21:13 — forked from webcracy/wordpress2tumblr.rb
WP - Import tumblr to WordPress
# Export your Wordpress posts to Tumblr (also allows to delete some.)
# Author: Alexandre Solleiro <alex@webcracy.org>
# How-to:
# 1. Export your Wordpress posts (http://en.blog.wordpress.com/2006/06/12/xml-import-export/)
# 2. Edit the information below to match your settings
# 3. To import, type "ruby wordpress2tumblr.rb --run" in the command line
# 4. To delete some posts, type "ruby wordpress2tumblr.rb --delete 1,2,3,4" where 1,2,3,4 are post numbers. (Be careful not to use spaces between IDs)
# Edit these
WP_EXPORT_PATH = "./wordpress.2009-09-14.xml" # path to the Wordpress Export file
@palimadra
palimadra / custom.css
Created March 27, 2012 13:05 — forked from mattonomics/custom.css
Thesis Skin Starter Template - Basic
/*---:[ body ]:---*/
body.custom { background: #000; }
@palimadra
palimadra / functions.php
Created March 27, 2012 13:05 — forked from mattonomics/functions.php
Thesis Child Theme - Advanced
<?php
if (! defined('ABSPATH'))
die('Please do not directly access this file');
include_once(TEMPLATEPATH . '/functions.php');
class thesis_child_theme_example extends thesis_custom_loop {
public function __construct() {
@palimadra
palimadra / custom.css
Created March 27, 2012 13:05 — forked from mattonomics/custom.css
Thesis Skin Starter Template - Advanced
/*---:[ body ]:---*/
body { background: #000; }
/*---:[ menu ]:---*/
.menu { list-style: none; }
.menu li { float: left; }
.menu li a { text-decoration: none; display: block; }
/*---:[ post image fix from @kristarella ]:---*/
.post_image { max-width: 100%; height: auto; }
@palimadra
palimadra / functions.php
Created March 27, 2012 13:05 — forked from mattonomics/functions.php
Thesis Child Theme - Basic
<?php
// Iinitial sanity check
if (! defined('ABSPATH'))
die('Please do not directly access this file');
// Bring in the main functions file so we have access to all the yummy Thesis goodness
include_once(TEMPLATEPATH . '/functions.php');
// we encourage you to set up a class. classes are a VERY important part of 2.0, so you need to be familiar with them.
@palimadra
palimadra / functions.php
Created March 27, 2012 13:05 — forked from mattonomics/functions.php
Thesis Child Theme - Advanced
<?php
if (! defined('ABSPATH'))
die('Please do not directly access this file');
include_once(TEMPLATEPATH . '/functions.php');
class thesis_child_theme_example extends thesis_custom_loop {
public function __construct() {
@palimadra
palimadra / css3nameplate.html
Created April 4, 2012 08:13
css3 nameplate
<DOCTYPE html>
<html>
<head>
<title>nameplate</title>
</head>
<style>
#angle {
width: 150px;
height: 150px;
background: #626262;
@palimadra
palimadra / .htaccess
Created April 15, 2012 16:02 — forked from necolas/.htaccess
Simple, quick way to concatenate, minify, and version static files in a Wordpress theme
# Filename-based cache busting
# taken from https://github.com/h5bp/html5-boilerplate/
# This rewrites file names of the form `name.123456.js` to `name.js`
# so that the browser doesn't use the cached version when you have
# updated (but not manually renamed) the file.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
@palimadra
palimadra / gist:3184355
Created July 26, 2012 20:37 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@palimadra
palimadra / blackandwhiteimages.php
Created August 2, 2012 18:43
Generate B + W images in WordPress
<?php
add_image_size('thumbnail-bw', 400, 0, false);
add_filter('wp_generate_attachment_metadata','bw_images_filter');
function bw_images_filter($meta) {
$file = wp_upload_dir();
$file = trailingslashit($file['path']).$meta['sizes']['thumbnail-bw']['file'];
list($orig_w, $orig_h, $orig_type) = @getimagesize($file);
$image = wp_load_image($file);
imagefilter($image, IMG_FILTER_GRAYSCALE);