Skip to content

Instantly share code, notes, and snippets.

@mattbanks
mattbanks / README.md
Created August 23, 2012 13:42 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@mattbanks
mattbanks / gist:3487914
Created August 27, 2012 12:13 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@mattbanks
mattbanks / Key Bindings - User
Created August 23, 2012 13:18
Sublime Text 2 Settings
[
{ "keys": ["super+alt+7"], "command": "encode_html_entities" },
{ "keys": ["shift+ctrl+u"], "command": "title_case" },
{ "keys": ["super+enter"], "command": "insert", "args": {"characters": "<br>\n"} },
{ "keys": ["super+alt+l"], "command": "insert_snippet", "args": {"contents": "<li>${0:$SELECTION}</li>" } },
{ "keys": ["super+alt+b"], "command": "insert_snippet", "args": {"contents": "<strong>${0:$SELECTION}</strong>" } },
{ "keys": ["super+alt+i"], "command": "insert_snippet", "args": {"contents": "<em>${0:$SELECTION}</em>" } },
{ "keys": ["super+alt+n"], "command": "insert_snippet", "args": {"contents": "<span>${0:$SELECTION}</span>" } },
{ "keys": ["super+alt+down"], "command": "insert_snippet", "args": {"contents": "<sub>${0:$SELECTION}</sub>" } },
@mattbanks
mattbanks / gist:4741474
Created February 8, 2013 19:50
Pods 2.3a7 post_content filters
function mb_show_testimonial() {
global $post;
$portfolio = pods( 'portfolio', $post->ID );
?>
<div class="testimonial">
<?php echo $portfolio->display( 'testimonial' ); ?>
</div>
<p class="author"><?php echo $portfolio->display( 'testimonial_author' ); ?></p>
@mattbanks
mattbanks / functions.php
Created February 11, 2013 16:04
Run custom loop for taxonomy archive for proper formatting, use pre_get_posts to change query to show all posts-per-page
/**
* Show header on archive pages
*/
function mb_archive_header() {
global $post;
echo '<h1 class="archive-title">Archive for &#8216;' . single_cat_title('', false) . '&#8217;</h1>';
}
/**
@mattbanks
mattbanks / Package Control.sublime-settings
Created February 13, 2013 19:13
package control user prefs file
{
"auto_upgrade_last_run": null,
"installed_packages":
[
"AdvancedNewFile",
"AndyJS2",
"ApacheConf.tmLanguage",
"Backbone.js",
"CoffeeScript",
"DocBlockr",
@mattbanks
mattbanks / package.json
Last active December 14, 2015 20:19
package.json for use with Grunt in developing and deploying WordPress themes
{
"name": "wordpress-starter-theme",
"version": "1.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-compass": "~0.2.0",
"grunt-contrib-imagemin": "~0.1.4",
"grunt-contrib-jshint": "~0.4.3",
"grunt-contrib-uglify": "~0.2.0",
@mattbanks
mattbanks / installing.php
Created March 21, 2013 14:24
Run wp_install() as an output script in an Alfred 2 Workflow
<?php
$site = $_GET['q'];
$dir = "/Users/MYUSERNAME/Sites/$site";
$siteUrl = "http://sites.dev/$site";
$username = 'MYUSERNAME';
$email = 'MYEMAIL';
$password = 'MYPASSWORD';
@mattbanks
mattbanks / Gruntfile-js-issue.js
Created April 9, 2013 13:44
Gruntfile.js where JS is not soft refreshing with LiveReload - getting a hard refresh for JS changes in the compiled *.min.js files after run through uglify
'use strict';
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
// watch for changes and trigger compass, jshint, uglify and livereload
watch: {
compass: {
#!/usr/bin/env ruby
# 1. export your RIL bookmarks
# 2. save this file to the same directory where your ril_export.html is
# 3. change username and password in the script bellow
# 4. run 'ruby ril_to_instapaper.rb' in terminal
require "cgi"
require "net/http"
require "net/https"