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 | |
$url = urlencode('http://wordpress.org'); | |
$width = 200; | |
$request = "http://s.wordpress.com/mshots/v1/$url?w=$width"; | |
echo "Link: $request"; |
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 | |
// Option 1: the follow method immediately references the relationship and saves it. | |
class User extends Eloquent { | |
public function follows() | |
{ | |
return $this->belongsToMany(self::class, 'follows', 'follower_id', 'followed_id'); | |
} |
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 | |
/** | |
* WordPress WP_QUERY-wrapper to simplify getting and working with posts | |
* | |
* Does something with posts, using a callback | |
* Setups global post variable before running callback | |
* And restores it afterwards | |
* | |
* An introductionary blogpost about this function is posted on our blog: |
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 | |
defined( 'ABSPATH' ) OR exit; | |
add_action( 'init', array( 'oxoImageSizesExtd', 'init' ), 0 ); | |
class oxoImageSizesExtd extends oxoImageSizes | |
{ | |
/** | |
* The Class Object | |
* @var |
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 | |
// Note, you need symfony/yaml to parse the Front Matter | |
if ( ! Input::hasFile('file')) | |
{ | |
// Do some fail here | |
return; | |
} | |
$contents = trim(File::get(Input::file('file')->getRealPath())); |
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
# | |
# Config file for sSMTP sendmail | |
# | |
# The person who gets all mail for userids < 1000 | |
# Make this empty to disable rewriting. | |
root=user@domain.com | |
# The place where the mail goes. The actual machine name is required no | |
# MX records are consulted. Commonly mailhosts are named mail.domain.com | |
mailhub=smtp.mandrillapp.com:587 |
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 | |
defined( 'ABSPATH' ) OR exit; | |
/** | |
* Plugin Name: (WCM) Faster Admin Post Lists | |
* Description: Reduces the queried fields inside WP_Query for WP_Post_List_Table screens | |
* Author: Franz Josef Kaiser <wecodemore@gmail.com> | |
* AuthorURL: http://unserkaiser.com | |
* License: MIT | |
*/ |
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
My Personal Setup Instructions from fresh OSX1.8 (Mountain Lion) install: | |
Some notes on why I have chosen some of these preferences: | |
I am primarlily a Ruby web developer, and work on a variety of Ruby and Rails versions and database platforms. | |
I usually use RVM (http://rvm.beginrescueend.com), but this guide uses [chruby](https://github.com/postmodern/chruby) | |
I spend most of my day in the Terminal, Atom editor, and a Web Browser, and desire to keep things as simple and stock as possible, but do have certain minor preferences that make my day-to-day interaction with the computer better. | |
Choose Full-Disk encryption on Install and set a password | |
Run software update until it cannot find any updates |
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 | |
/** | |
* Plugin Name: Remove Builtin WP Taxonomies | |
*/ | |
add_action( 'init', 'unregister_taxonomy' ); | |
/** | |
* Remove built in taxonomies | |
* @author: Franz Josef Kaiser | |
*/ |
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
var fs = require('fs'), | |
path = require('path'), | |
_ = require('underscore'), | |
when = require('when'), | |
express = require('express'), | |
GhostPlugin = require('../../../core/server/plugins/GhostPlugin'), | |
knex = require('../../../core/server/models/base').Knex, | |
KudosPlugin; | |
KudosPlugin = function (ghost) { |
OlderNewer