Skip to content

Instantly share code, notes, and snippets.

function random(seed)
{
if (!seed)
seed = new Date().getTime();
seed = (seed*9301+49297) % 233280;
return seed/(233280.0);
}
document.write("using random(1): " + random(1));
document.write("<br>");
<br />
<b>Fatal error</b>: Call to undefined function ImageColorMatch() in <b>/srv/jqueryui.com/htdocs/themeroller/images/phpthumb.filters.php</b> on line <b>1040</b><br />
@pgib
pgib / .htaccess
Created May 14, 2010 22:34
Redirect IE 6 users to the bad milk campaign
# Redirect IE 6 users to Microsoft's expired milk campaign
RewriteCond %{HTTP_USER_AGENT} MSIE\ 6
RewriteRule .* http://www.microsoft.com/australia/technet/ie8milk/
alias restart_nvidia="restart_thin ~/nvidia_gtc"
alias restart_renesas="restart_thin ~/renesas_devcon"
restart_thin()
{
origpath=`pwd`
path=$1
if [ -z "$path" ]; then
echo "Usage: restart_thin <app root path>"
# add this into your ~/.bash_profile
# git branch highlighting
function parse_git_branch
{
branch=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'`
if [ -n "$branch" ]; then
echo "${branch} "
fi
}
Xen Minimal OS!
start_info: 0xa01000(VA)
nr_pages: 0x26700
shared_inf: 0xdebfb000(MA)
pt_base: 0xa04000(VA)
nr_pt_frames: 0x9
mfn_list: 0x967000(VA)
mod_start: 0x0(VA)
mod_len: 0
flags: 0x0
find / -type f -name copyright.htm -exec sed -i .bak -e 's/Copyright © 20../Copyright © 2011/g' {} \;
#!/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