dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | grep -E "(image|headers)" | xargs sudo apt-get -y purge
This file contains hidden or 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
public function embedWrapper($html, $url, $attr) | |
{ | |
$classes = ['post-embed']; | |
if (strpos($url, 'youtu.be') !== false || strpos($url, 'youtube.com') !== false || strpos($url, 'vimeo') !== false) { | |
$classes[] = 'post-embed--video'; | |
} else if (strpos($url, 'twitter.com') !== false) { | |
$classes[] = 'post-embed--twitter'; | |
} | |
$classes = implode(' ', $classes); | |
return '<figure class="' . $classes . '">' . $html . '</figure>'; |
This file contains hidden or 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
#!/bin/bash | |
# Sometimes you need to move your existing git repository | |
# to a new remote repository (/new remote origin). | |
# Here are a simple and quick steps that does exactly this. | |
# | |
# Let's assume we call "old repo" the repository you wish | |
# to move, and "new repo" the one you wish to move to. | |
# | |
### Step 1. Make sure you have a local copy of all "old repo" | |
### branches and tags. |
This file contains hidden or 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Redirect upload requests to staging site | |
RewriteRule ^wp-content/uploads/(.*)$ http://staging.domain.com/wp-content/uploads/$1 [L,R=301] | |
# WP redirects follow... | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] |
I'll try and flesh this out a little further when I get time, but here are links to the general tools and resources I use on a daily basis!
Find the fonts you want to copy:
# Show hidden files in Finder
defaults write com.apple.finder AppleShowAllFiles YES
# Location of Typekit Synced fonts
cd /Users/daveaspinall/Library/Application\ Support/Adobe/CoreSync/plugins/livetype/.r
This file contains hidden or 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 gulp = require('gulp'); | |
var sass = require('gulp-ruby-sass'); | |
var uncss = require('gulp-uncss'); | |
var livereload = require('gulp-livereload'); | |
var notify = require('gulp-notify'); | |
var zip = require('gulp-zip'); | |
var lr = require('tiny-lr'); | |
var server = lr(); | |
var premailer = require('gulp-premailer'); |