Skip to content

Instantly share code, notes, and snippets.

class Gitalist::Git::Repository {
...
use if $^O ne 'MSWin32', 'I18N::Langinfo', => qw/langinfo CODESET/;
BEGIN {
no strict 'subs';
*__owner = defined &langinfo
? method { map { decode(langinfo(CODESET), $_) } (getpwuid $self->path->stat->uid)[6,0] }
: method { return qw/OwnEr GroUp/ }
;
}
@broquaint
broquaint / Gitalist URI structure
Created January 22, 2010 20:15
Gitalist URI structure
/projects ?sortOptions
/<repo>/summary
/<repo>/<commit sha1>/commit
/<repo>/<commit sha1>/diff
/<repo>/<commit sha1>/patch
/<repo>/<commit sha1>/snapshot
/<repo>/<commit sha1>/tree
/<repo>/<commit sha1>/tree/<path>
/<repo>/<commit sha1>/blame/<file name>
/<repo>/<commit sha1>/blob/<file name>
/ ?sortOptions Root repository listing.
/<repo> Repository summary page
/<repo>/shortlog Short log
/<repo>/log Full log
/<repo>/heads Branches
/<repo>/tags Tags
/<repo>/reflog Reflog
/<repo>/<commit sha1> Commit
/<repo>/<commit sha1>/diff Commit diff
/<repo>/<commit sha1>/patch Commit patch
#!/usr/bin/env perl
# XXX Assumes bootstrap.pl has already run
use FindBin;
BEGIN {
$ENV{CATALYST_LOCAL_LIB} = 1;
do "$FindBin::Bin/env" or die $@;
}
__PACKAGE__->config(
default => 'text/html',
skip => { 'application/xml' => 1 },
map => {
'application/json' => [qw/ JSON /],
map { $_ => [qw/ View Default /] }
qw( text/css text/html text/plain
application/atom+xml application/rss+xml
application/rss application/xml )
}
@broquaint
broquaint / sorladmin_script.pl
Created January 28, 2011 12:48
The wee script I mentioned.
#!/usr/bin/env perl
use FindBin;
use local::lib "$FindBin::Bin/../local-lib";
use lib 'lib';
#use Solr::Admin::Web;
use Web::Simple 'Solr::Admin::Web';
@broquaint
broquaint / gde33_example.user.js
Created June 21, 2011 11:15
Working example of GM_xmlhttpRequest speaking XML
// ==UserScript==
// @name gde33 XML example
// @namespace https://github.com/broquaint
// @description Working example of GM_xmlhttpRequest speaking XML
// @include http://en.wikipedia.org/wiki/Main_Page
// ==/UserScript==
// For some reason console.log wasn't working, too lazy to investigate why.
unsafeWindow.console.log("Requesting stuff!");
GM_xmlhttpRequest({
@broquaint
broquaint / gist:1320861
Created October 27, 2011 21:01
build_per_context_instance loading a model from command-line args
sub build_per_context_instance {
my ($self, $app) = @_;
my %args = (export_ok => $self->export_ok || '');
my $class;
# Try to get the model from command-line args first.
GetOptionsFromArray($app->run_options->{extra_argv}, 'model=s' => \$class);
@broquaint
broquaint / lmip.pl
Created November 6, 2011 22:00
Last Mangle in Paris - a POC for Gitalist's simplified ContentMangler
package lmip;
use Modern::Perl;
use Method::Signatures;
use Clone qw(clone);
use Term::ANSIColor qw(:constants);
my %config = (
diff => {
default => 'synhl_diff',
@broquaint
broquaint / gist:1374748
Created November 17, 2011 22:24
The inverse of clojure.test/is
(defmacro isnt [form msg]
'(is '(not form) 'msg))