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
Options +FollowSymlinks -MultiViews | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_URI} !articles\.html [NC] | |
RewriteCond %{REQUEST_URI} ^/articles/([^/]+)/? [NC] | |
RewriteRule .* /articles.html#%1 [R,NE,L] |
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
#!/usr/bin/env bash | |
# | |
# How to use this file: | |
# | |
# 1. Clone/copy this gist into the .git/hooks directory | |
# 2. Enter the website's domain and server's admin username in the variables | |
# 3. Make the file executable using: $ chmod +x post-merge | |
# |
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: Disable plugins when doing local dev | |
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify | |
Version: 0.1 | |
License: GPL version 2 or any later version | |
Author: Mark Jaquith | |
Author URI: http://coveredwebservices.com/ | |
*/ |
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
#!/bin/sh | |
# | |
# This hook will append the current branch name to | |
# the commit message if it's not already there. | |
ref=$(git symbolic-ref HEAD 2> /dev/null) | |
branch=${ref#refs/heads/} | |
if [[ "$branch" != "master" ]]; then | |
grep -qa "$branch" "$1" || echo "\n[Branch: $branch]" >> "$1" |
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
#!/bin/sh | |
# | |
# A hook script to export your database on every commit. | |
# | |
# The export is saved to a temp file. If the export | |
# fails, the file is trashed. Otherwise it overwrites the tracked file. | |
# | |
# Called by "git commit" with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. |
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
$file = 'http://www.example.com/path/to/file.ext'; | |
$headers = array_change_key_case(get_headers($file, TRUE)); | |
$filesize = $headers['content-length'][1]; | |
if ( $headers[0] != 'HTTP/1.1 404 Not Found' ) { | |
header('Content-Description: File Transfer'); | |
header('Content-Type: application/octet-stream'); | |
header('Content-Disposition: attachment; filename='.basename($file)); |
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
function git_prompt_info() { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" | |
} | |
function get_pwd() { | |
print -D $PWD | |
} | |
function put_spacing() { |
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
#!/bin/bash | |
SOLERIZED='{ | |
"Ansi 0 Color" = { | |
"Blue Component" = 0.19370138645172119; | |
"Green Component" = 0.15575926005840302; | |
"Red Component" = 0.0; | |
}; | |
"Ansi 1 Color" = { | |
"Blue Component" = 0.14145714044570923; |
NewerOlder