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
# I love tpope's solution to ctags regeneration[1]; he creates | |
# a template from which all Git repositories take their default hooks, | |
# and then uses these hooks to regenerate ctags. | |
# | |
# [1]: http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html | |
# | |
# It's an elegant solution, but what do you do about repositories that | |
# already exist? The template will only apply to newly cloned or newly | |
# initialised repositories. | |
# |
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
# git branch-name: prints the name of the branch in a safe/scriptable/non-porcelain way | |
# git publish: publishes the current branch on the remote "origin", using the same name as the current branch | |
# git unpublish: deletes the remote branch with the same name as the current one (potentially destructive) | |
# git recreate: given a branch name, recreates the branch with that name from the latest master. Deletes both the local and remote copy of the branch first. Very destructive, use with caution | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
publish = "!git push -u origin $(git branch-name)" | |
unpublish = "!git push origin :$(git branch-name)" | |
recreate = "!f() { [[ -n $@ ]] && git checkout \"$@\" && git unpublish && git checkout master && git branch -D \"$@\" && git checkout -b \"$@\" && git publish; }; f" |
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
# The best place to put this is your `fastcgi_params` file. | |
set $_ssl "off"; | |
# We run SSL on ports 443+, not just one port, to get | |
# around the lack of SNI in clients' browsers; you might | |
# safely be able to use "$server_port = 443" | |
if ( $server_port != 80 ) { | |
set $_ssl "on"; | |
} |
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
# Usage: | |
# git tag-review 'Rob Miller <[email protected]>' | |
tag-review = "!f() { git commit --amend -m \"$(git log -1 --pretty=\"format:%s%n%n%b%n%nReviewed-by: $1\")\"; }; f" |
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
# `git merge-log` shows the commits that were introduced in a given merge | |
# `git merge-diff` shows the actual changes that were introduced by a given merge | |
# Both commands accept an optional commitish; if ommitted, the last merge commit is used | |
merge-span = "!f() { echo $(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f1)$1$(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f2); }; f" | |
merge-log = "!git log `git merge-span .. $1`" | |
merge-diff = "!git diff `git merge-span ... $1`" | |
merge-difftool = "!git difftool `git merge-span ... $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
# usage, e.g.: | |
# git difftool `git last-merge` | |
# or: | |
# git log `git last-merge` | |
last-merge = "!echo $(git log -1 --merges --pretty=format:%P | cut -d' ' -f1)..$(git log -1 --merges --pretty=format:%P | cut -d' ' -f2)" |
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: Damn Vulnerable WordPress Plugin | |
* Description: Intentionally vulnerable plugin for plugin author education | |
* Version: 0.1 | |
* Plugin URI: http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/ | |
* Author: Jon Cave | |
* Author URI: http://joncave.co.uk | |
* License: GPLv2+ | |
* | |
* DO NOT RUN THIS PLUGIN ON AN INTERNET ACCESSIBLE SITE |
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
while true; do [[ `curl -ILs http://example.com/ | grep 'Age:' | sed 's/Age: //'` < 10 ]] && say "It updated"; sleep 5; done |
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
augroup sourcesession | |
autocmd! | |
autocmd VimEnter * nested | |
\ if !argc() && empty(v:this_session) && filereadable('Session.vim') | | |
\ source Session.vim | | |
\ endif | |
augroup END |
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 | |
# git-cleanup-repo | |
# | |
# Author: Rob Miller <[email protected]> | |
# Adapted from the original by Yorick Sijsling | |
git checkout master &> /dev/null | |
# Make sure we're working with the most up-to-date version of master. | |
git fetch |