Skip to content

Instantly share code, notes, and snippets.

@mps
mps / functions.php
Created June 19, 2012 19:46
Hide the WordPress admin bar in two lines of code
add_filter( 'show_admin_bar', '__return_false' );
@mps
mps / deploying.md
Created June 21, 2012 14:54
Free WordPress Hosting on Heroku

Deploy to Heroku

$ git push heroku production:master
> -----> Heroku receiving push
> -----> PHP app detected
> -----> Bundling Apache v2.2.19
> -----> Bundling PHP v5.3.6
> -----> Discovering process types

> Procfile declares types -> (none)

@mps
mps / gist:3691140
Created September 10, 2012 14:14
EDD Content
This method also appends a Checkout Box to whatever the user entered in for a Download's content.
<?php the_content('Read the rest of this entry &raquo;'); ?>
Is there a way to not have the Checkout Box appended?
@mps
mps / gist:5415670
Last active December 16, 2015 09:49
NSMutableDictionary* attributes = [[NSMutableDictionary alloc]init];
// p
UIFont *paragraphFont = [UIFont fontWithName:@"Helvetica" size:12.0];
NSMutableParagraphStyle* pParagraphStyle = [[NSMutableParagraphStyle alloc]init];
pParagraphStyle.paragraphSpacing = 12;
pParagraphStyle.paragraphSpacingBefore = 12;
NSDictionary *pAttributes = @{ NSFontAttributeName : paragraphFont, NSParagraphStyleAttributeName : pParagraphStyle };
@mps
mps / gist:5576596
Created May 14, 2013 15:00
Gitty description
We think Gitty is the best way to use GitHub for iOS. Here are some features users can expect:
News Feeds and Notifications
• Stay up to date with the latest events for repositories you star and contribute to as well as all of your organizations' activities. Gitty makes looking at these events beautiful and easy to follow.
• Gitty allows you to easy see and read GitHub notifications with the deep linking you have come to expect.
Repositories, Users and Organizations
• Easily access your private and public repositories' code and issues.
@mps
mps / InfoPlist.strings
Created May 23, 2013 14:35
Gitty Translation File
/* Localized versions of Info.plist keys */
"Credits" = "Credits";
"Here are some great libraries I used to create this application:" = "Here are some great libraries I used to create this application:";
"About" = "About";
"Thank You" = "Thank You";
"Thank you to the amazing team at GitHub for creating a great product, without their hard work, none of this would have been possible." = "Thank you to the amazing team at GitHub for creating a great product, without their hard work, none of this would have been possible.";
"About the Developer" = "About the Developer";
"Icon Design" = "Icon Design";
@mps
mps / Rakefile
Last active December 18, 2015 15:49
A rake task for revving plist build version numbers...
def revBuild(plistFile)
puts "Attempting to update #{plistFile} build version..."
oldVersion = `/usr/libexec/PlistBuddy -c "Print CFBundleVersion" #{plistFile}`
puts "The old version: #{oldVersion}"
versionParts = oldVersion.split(".")
previousDate = versionParts[2]
newDate = Time.now.strftime("%Y%m%d")
versionParts[2] = newDate
@mps
mps / xml_image_downloader.rb
Created June 20, 2013 22:02
Open an XML file and download images from its nodes...
require 'rubygems'
require 'nokogiri'
require 'open-uri'
XML_FILE_LOCATION = 'path/to/my/xml/file.xml'
XML_XPATH = '//ANode'
XML_ATTR_FOR_IMAGE_NAME = 'imagename'
XML_ATTR_FOR_IMAGE_URL = 'imageurl'
file = File.open(XML_FILE_LOCATION, "rb")
@mps
mps / Localizable.strings
Created June 26, 2013 17:05
French Gitty Translation
/* Localized versions of Info.plist keys French */
"Credits" = "Crédits";
"Here are some great libraries I used to create this application:" = "Here are some great libraries I used to create this application:";
"About" = "À propos";
"Thank You" = "Remerciements";
"Thank you to the amazing team at GitHub for creating a great product, without their hard work, none of this would have been possible." = "Merci à l'équipe extraordinaire à GitHub pour créer un excellent produit, sans leur travail acharné, rien de tout cela n'aurait été possible.";
"About the Developer" = "À propos du Développeur";
"Icon Design" = "Icon Design";
source 'http://rubygems.org'
# Make sure you have bundler installed
# gem install bundler
gem 'shenzhen'