Skip to content

Instantly share code, notes, and snippets.

View theory's full-sized avatar
💭
🥃

David E. Wheeler theory

💭
🥃
View GitHub Profile
=item C<< <change>^ >>, e.g., C<HEAD^^>, C<users_table^3>, C<@beta^2>
A suffix C<^> to a symbolic or actual name means the change I<prior> to that
change. Multiple C<^>s indicate multiple prior changes. These can also be
written as C<< ^<n> >>, where C<< <n> >> represents the number of changes to
go back.
=item C<< <change>~ >>, e.g., C<ROOT~>, C<foo~~>, C<@bar~4>
A suffix C<~> to a symbolic or actual name that means the change I<after> that
name = App-Sqitch
version = 0.81
author = David E. Wheeler <[email protected]>
license = MIT
copyright_holder = David E. Wheeler
[GatherDir]
[PruneCruft]
[ManifestSkip]
> dzil test
[DZ] building test distribution under .build/KtHOkymRpC
[DZ] beginning to build App-Sqitch
[DZ] guessing dist's main_module is lib/App/Sqitch.pm
[DZ] extracting distribution abstract from lib/App/Sqitch.pm
[DZ] attempt to add MANIFEST multiple times; added by: GatherDir (Dist::Zilla::Plugin::GatherDir line 103); Manifest (Dist::Zilla::Plugin::Manifest line 37)
[DZ] attempt to add META.json multiple times; added by: GatherDir (Dist::Zilla::Plugin::GatherDir line 103); MetaJSON (Dist::Zilla::Plugin::MetaJSON line 58)
[DZ] attempt to add META.yml multiple times; added by: GatherDir (Dist::Zilla::Plugin::GatherDir line 103); MetaYAML (Dist::Zilla::Plugin::MetaYAML line 58)
aborting; duplicate files would be produced at /usr/local/lib/perl5/site_perl/5.16.0/Dist/Zilla/App/Command/test.pm line 28.
@theory
theory / gist:1542242
Created December 31, 2011 00:41
How to add a Transaction Guard to a DBIx::Connector Subclass
package DBIx::Connector::TxnGuard;
use strict;
use warnings;
use Carp;
sub new {
my ($class, $dbh) = @_;
$dbh->begin_work;
return bless { dbh => $dbh };
}
#!/bin/sh
pwd=`pwd`
for i in dot.*
do
if [ -d "$i" ]
then
for j in `find $i -type file`
do
s=`echo $j | sed -e s/^dot//`
@theory
theory / partition_test.sql
Created August 2, 2011 17:18
PostgreSQL Partitioning Test
\pset pager off
BEGIN;
SET client_min_messages = warning;
CREATE TABLE widgets (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
created_at TIMESTAMP NOT NULL
);
@theory
theory / appalled.txt
Created August 1, 2011 16:13
Reason for Opting Out of barackobama.com Email Lists
President Obama far exceeded my expectation of being disappointed. I am appalled at his
near complete lack of leadership. The debt debate is the final straw. I have no clue
how I'll vote in 2012, but I sincerely hope that someone willing to go to the matt for
the american people will primary President Obama.
@theory
theory / gist:926896
Created April 19, 2011 06:06
LatLon Example
CLLocationCoordinate2D coord = location.coordinate;
CLLocationDegrees south = LatLonDestPoint(coord, 180.0, 100000).latitude;
CLLocationDegrees west = LatLonDestPoint(coord, 270.0, 100000).longitude;
CLLocationDegrees north = LatLonDestPoint(coord, 0.0, 100000).latitude;
CLLocationDegrees east = LatLonDestPoint(coord, 90.0, 100000).longitude;
NSLog(@"Location: %.4f,%.4f", coord.latitude, coord.longitude);
NSLog(@"Connecting with %@", [NSString stringWithFormat:@"%.4f,%.4f,%.4f,%.4f", south, west, north, east]);
/* Output:
- (UIImage *)fetchImageforURL:(NSString *)theUrl {
@try {
return [UIImage imageWithContentsOfFile:[self filenameForKey:theUrl.md5Hash]];
}
@catch (NSException * e) {
// Ugh, the file must be bad. Clean up and return nil.
[self removeImageForUrl:theUrl];
return nil;
}
}
@theory
theory / gist:710835
Created November 22, 2010 22:22
static password trigger
CREATE OR REPLACE FUNCTION static_user(
) RETURNS TRIGGER LANGUAGE plpgsql AS $$
BEGIN
NEW.password := OLD.password;
NEW.login := OLD.login;
RETURN NEW;
END;
$$;
CREATE TRIGGER static_user BEFORE UPDATE ON usr