Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
my @directories = qw(/var/www/html /var/www/html2 /etc); #if you don't know all the directories and are okay with the script running for a while you could just specify /
my $line = quotemeta("Copyright 2010"); # Or whatever your line actually is . . .
my $copyright_file = quotemeta("copyright.htm");
find(\&wanted, @directories);

Awesome walnut dressing

  • 1/2 cup walnuts
  • 1 garlic glove
  • 3 tsp red/white wine vinegar(1)
  • 1 tsp balsamic vinegar(1)
  • 1 tbsp walnut oil
  • Salt and freshly milled pepper
  • Pinch of cayenne pepper
#!/bin/sh
latest=`ssh adobe@aapp.coverallcrew.com ls -1 /home/adobe/Backups/adobe_agency_partner_portal_production | tail -n 1`
echo "Found ${latest}. Downloading..."
scp adobe@aapp.coverallcrew.com:/home/adobe/Backups/adobe_agency_partner_portal_production/$latest .
echo "run:"
echo
echo "gzcat $latest | mysql adobe_agency_partner_portal_production"
echo
@pgib
pgib / Function and command alias example
Created April 26, 2011 18:47
function-and-command-alias-example.vim
function StripTrailingWhitespace()
:%s/\s\+$//
echo "Trailing white space stripped."
endfunction
command Stripwp :call StripTrailingWhitespace()
@pgib
pgib / net.lighttpd.spawn-fcgi.plist
Created April 27, 2011 23:16
spawn-fcgi launchctl plist for use with php-cgi
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.lighttpd.spawn-fcgi</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
@pgib
pgib / com.coverallcrew.firewall.plist
Created April 28, 2011 06:33
Our firewall start-up script to forward port 80 to our local nginx on 8080
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.coverallcrew.firewall</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
@pgib
pgib / gist:965951
Created May 11, 2011 05:15
`brew install -v imagemagick` output
$ brew install imagemagick
Also installing dependencies: jpeg, little-cms
==> Downloading http://www.ijg.org/files/jpegsrc.v8c.tar.gz
File already downloaded and cached to /Users/patrick/Library/Caches/Homebrew
==> ./configure --prefix=/usr/local/Cellar/jpeg/8c --disable-dependency-tracking
==> make install
/usr/local/Cellar/jpeg/8c: 17 files, 1.4M, built in 11 seconds
==> Downloading http://www.littlecms.com/1/lcms-1.19.tar.gz
File already downloaded and cached to /Users/patrick/Library/Caches/Homebrew
@pgib
pgib / brew doctor
Created May 12, 2011 05:45
brew install -v little-cms
$ brew doctor
Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libdvdcss.2.0.7.dylib
/usr/local/lib/libdvdcss.2.dylib
@pgib
pgib / create-branch.sh
Created August 26, 2011 17:55
Put this in your shell's respective dot profile and smoke it!
# create a new git branch
function create-branch
{
local branchtype=$1
local name=$2
local issue=$3
date=`date +%Y%m%d`
if [ $# -lt 2 ]; then
@pgib
pgib / mydevices.html
Created October 14, 2011 22:40
Commented out code in Lion Server's My Devices
<!-- <div class="profile">
<div class="name">First Ad-Hoc</div>
<p class="description">This adds some stuff to your device.</p>
<a href="http://apple.com"><div class="button"><canvas></canvas></div></a>
<p class="getJoin">Get</p>
</div>
<div class="profile">
<div class="name">Second Ad-Hoc</div>
<p class="description">This adds some different stuff to your device.</p>
<a href="http://apple.com"><div class="button"><canvas></canvas></div></a>