Skip to content

Instantly share code, notes, and snippets.

View willert's full-sized avatar

Sebastian Willert willert

  • Göttingen, Germany
View GitHub Profile
(defun git-commit-insert-header (type name email &optional note)
(let* ((signoff-at (git-commit-find-pseudo-header-position))
(prev-line (save-excursion
(goto-char (- signoff-at 1))
(thing-at-point 'line)))
(pre (if (or (string-match "^[^\s:]+:.+$" prev-line)
(string-match "\\`\s*$" prev-line))
"" "\n"))
(has-content (stringp note))
(insert (lambda ()
(defun git-commit-insert-header (type name email &optional note)
(let* ((signoff-at (git-commit-find-pseudo-header-position))
(prev-line (progn
(save-excursion
(goto-char (- signoff-at 1))
(thing-at-point 'line))))
(pre (if (or (string-match "^[^\s:]+:.+$" prev-line)
(string-match "\\`\s*$" prev-line))
"" "\n"))
(org (pointer)))
(let ((redo t))
(while redo
(goto-char (+ start 1))
(setq redo nil)
(let* ((this-block (sbw/ab-get-containing-block (point)))
(start-of-block (pop this-block))
(end-of-block (pop this-block)))
(mapcar
(lambda (this)
#!/usr/bin/perl
use strict;
use warnings;
use Mail::Box::Mbox;
use Encode;
use open ':std' => ':utf8';
SELECT
id,
id AS user_id,
username,
CASE user_privacy.person WHEN 2 THEN firstname END AS firstname,
CASE user_privacy.person WHEN 2 THEN surname END AS surname,
CASE user_privacy.person WHEN 2
THEN UNIX_TIMESTAMP( user_profile.birthday ) END AS birthday,
CASE user_privacy.person WHEN 2 THEN DAY( user_profile.birthday )
END AS birthday_dom,
INSERT INTO
H_ANLAGEN_2001 ( BVDEP_ID_NUMBER, PATENTE, GOODWILL, LAND, GEBAUDE, MASCHIENEN )
SELECT
ASSETS.BVDEP_ID_NUMBER,
ASSETS.INTANGIBLE_FIXED_ASSETS * 0.5,
ASSETS.INTANGIBLE_FIXED_ASSETS * 0.5,
(EXTRA.DEPRECIATION - (0.429 * ASSETS.TANGIBLE_FIXED_ASSETS)) / 0.461 * 2 / 3,
(EXTRA.DEPRECIATION - (0.429 * ASSETS.TANGIBLE_FIXED_ASSETS)) / 0.461 * 1 / 3,
ASSETS.TANGIBLE_FIXED_ASSETS -
((EXTRA.DEPRECIATION - (0.429 * ASSETS.TANGIBLE_FIXED_ASSETS)) / 0.461))
#!/usr/bin/perl
use strict;
use warnings;
use lib '/home/willert/Devel/exparse-interpreter/lib';
use lib '/home/willert/Devel/sig/lib';
use Gtk2 -init;
use Gtk2::WebKit;
Couldn't instantiate component "SiG::Model::Repository", "Couldn't load class (Exparse::Questionnaire::Storage::DBIC) because: The method '_process_options' was not found in the inheritance hierarchy for Class::MOP::Class::__ANON__::SERIAL::39 at /usr/local/lib/perl/5.10.1/Class/MOP/Class.pm line 659
Class::MOP::Class::__ANON__('Moose::Meta::Class=HASH(0xb872450)', '_process_options') called at /usr/local/lib/perl/5.10.1/Class/MOP/Class.pm line 694
Class::MOP::Class::add_after_method_modifier('Moose::Meta::Class=HASH(0xb872450)', '_process_options', 'CODE(0xa6b48b0)') called at /usr/local/lib/perl/5.10.1/Moose/Meta/Role/Application/ToClass.pm line 218
Moose::Meta::Role::Application::ToClass::apply_method_modifiers('Moose::Meta::Role::Application::ToClass=HASH(0xa7df158)', 'after', 'Moose::Meta::Role=HASH(0xa6b1e08)', 'Moose::Meta::Class=HASH(0xb872450)') called at /usr/local/lib/perl/5.10.1/Moose/Meta/Role/Application.pm line 93
Moose::Meta::Role::Application::apply_after_method_modifiers('Moose::Meta::Ro
package WuB::Schema::ResultSet;
use base qw/DBIx::Class::ResultSet/;
sub has_rows {
my $self = shift;
my @pk = $self->result_source->primary_columns;
my $first_row = $self->search( undef, {
select => \@pk,
rows => 1,
order_by => \'1'
my %args = %{ $self->interp_args || {} };
if ( my $enc = $self->encoding ) {
my $old_func = delete $args{ postprocess_text };
$args{ postprocess_text } = sub{
$old_func->( $_ ); $_ = $enc->decode( $_ );
};
}
return $self->interp_class->new(
%args