Skip to content

Instantly share code, notes, and snippets.

View EpocSquadron's full-sized avatar

Daniel S Poulin EpocSquadron

View GitHub Profile
{% include "_components/breadcrumbNavigation" with {
content: {
list: [
{
hyperlink: {
url: url('blog'),
text: 'blog'|t('site/navigation')
}
},
{
@EpocSquadron
EpocSquadron / git-largest-files.sh
Created January 15, 2014 22:48
Script to find the largest files in a git history, with the intent to use the list to filter-branch remove the files forever.
#!/bin/bash
# Adapted from http://blog.jessitron.com/2013/08/finding-and-removing-large-files-in-git.html
BRANCH_LIST=$@
filesAndSizes() {
# Get all files recursively in this revision
@EpocSquadron
EpocSquadron / .rsyncignore
Created October 18, 2013 14:21
An rsync snippet for syncing files from a non-git server without all the junk.
*.bak
*.diff
*.patch
*.md
*.err
*.orig
*.log
*.rej
*.swo
*.swp
@EpocSquadron
EpocSquadron / .htaccess
Created August 28, 2013 14:30
Htaccess snippet for forcing trailing slash at the end of urls.
# ------------------------------------------------------------------------------
# | Suppressing / Forcing the "/" at the end of URLs |
# ------------------------------------------------------------------------------
# Place this underneath the 'Suppressing / Forcing the "www."'
# section of the h5bp file, or just ensure it occurs before the
# index.php rewrite.
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
@EpocSquadron
EpocSquadron / new_gist_file
Created August 26, 2013 15:58
SQL for left padding zipcodes that are already in the database.
UPDATE `table` SET `zip` = LPAD(`zip`, 5, '0');
@EpocSquadron
EpocSquadron / pngcrawl.sh
Created August 15, 2013 16:03
Crawl pages from a csv file
#!/bin/bash
cat "$1" | while read line; do
./pngtake.sh $line
done
echo "Done."
exit 0
@EpocSquadron
EpocSquadron / new_gist_file
Created June 17, 2013 19:49
Screencapture on linux
For video only:
ffmpeg -f x11grab -r 25 -s 1440x900 -i :0.0 -vcodec libx264 -preset ultrafast -crf 0 output.mkv
For video and audio:
// Regex for finding all exp:channel:entries tags that have no disable attribute set.
\{exp:channel:entries(?!.*disable).*?\}
@EpocSquadron
EpocSquadron / new_gist_file
Created April 8, 2013 20:26
Failed attempt at automating front-end testing.
## Unicorn
Make sure brew is up to date and install apache-ivy.
brew update
brew install ivy
Create a working directory for compiling and clone from mercurial.
mkdir -p ~/Projects/local
@EpocSquadron
EpocSquadron / new_gist_file
Created April 8, 2013 20:25
Use php-build and php-version for multiple concurrent versions of php on your dev box.
Install php-build:
sudo apt-get build-dep php5-cli git
git clone git://github.com/CHH/php-build
sudo php-build/install.sh
Install php-version:
git clone https://github.com/wilmoore/php-version.git
sudo ln -s php-version/php-version.sh /usr/local/bin/php-version