Skip to content

Instantly share code, notes, and snippets.

@Htbaa
Htbaa / .vimrc
Last active February 21, 2024 08:11
" Install https://github.com/junegunn/vim-plug first
call plug#begin()
" On-demand loading
Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'preservim/nerdcommenter'
Plug 'powerline/powerline'
Plug 'mattn/emmet-vim'
Plug 'chreekat/vim-paren-crosshairs'
Plug 'vim-perl/vim-perl'
Plug 'dense-analysis/ale'
@Htbaa
Htbaa / http.go
Last active December 16, 2015 05:19
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
resp, err := http.Get("http://maximus.htbaa.com/module/sources/json")
#!/bin/sh
### BEGIN INIT INFO
# Provides: Maximus
# Required-Start: $syslog $network
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Maximus script
# Description: Maximus script
@Htbaa
Htbaa / validation_class_test.pl
Created August 12, 2012 10:56
More Validation::Class woes
package Foo;
use Validation::Class;
directive 'is_troll' => sub {
my ($dir, $value, $field, $self) = @_;
foreach (@{$value}) {
if ($_->[1] !~ /application\/(x-)?pdf/i) {
$field->{errors}->add(sprintf('Error for %s', $_->[0]));
}
}
@Htbaa
Htbaa / maximus_mojo_dbi.patch
Created August 11, 2012 10:56
Patch for maximus_mojo.pl to use DBI instead of DBIx::Class. Doesn't lower memory usage though!
diff --git script/maximus_mojo.pl script/maximus_mojo.pl
index 161c349..f0c7373 100644
--- script/maximus_mojo.pl
+++ script/maximus_mojo.pl
@@ -3,7 +3,7 @@ use lib "./lib";
use local::lib;
use Mojolicious::Lite;
use Config::Any;
-use Maximus::Schema;
+use DBI;
@Htbaa
Htbaa / vc_numeric_filter_on_arrayref.pl
Created August 9, 2012 17:13
Validation::Class woes
package Foo;
use Validation::Class;
field 'foobar' => {
required => 1,
filters => 'numeric', # Comment this one out to make it work
default => [1,2],
};
package main;
@Htbaa
Htbaa / console_sinus.cs
Created October 26, 2011 10:21
Drawing a sinus with Console.WriteLine
static void PrimitieveSinus()
{
var positions = from x in Enumerable.Range(0,79)
select new { x, y = (int)(Math.Sin(x) * 2) };
positions = positions.OrderBy(p => p.y).ThenBy(p => p.x);
var y_pos = positions.GroupBy(p => p.y).Select(p => p.Key);
foreach (int y in y_pos)
{
@Htbaa
Htbaa / .gitignore
Created September 3, 2011 20:05
BlitzMax Indexer
*.xml
.*
!.gitignore
Makefile*
!Makefile.PL
META.yml
MYMETA.*
blib
build
/inc
@Htbaa
Htbaa / calendar-eightysix-mootools-1.3.patch
Created May 18, 2011 09:19
Patch for Calendar EightySix 1.1 to support MooTools 1.3
--- C:/Users/christiaan/Downloads/calendar-eightysix-v1.1/js/calendar-eightysix-v1.1.js Sun Apr 25 19:02:52 2010
+++ P:/klantendossier/release/www/layout/js/calendar-eightysix-v1.1-uncompressed.js Wed May 18 11:12:02 2011
@@ -79,11 +79,11 @@
});
//Create the currect selected date
- if($defined(this.options.defaultDate))
+ if(this.options.defaultDate != null)
this.selectedDate = new Date().parse(this.options.defaultDate).clearTime();
- else if(this.options.linkWithInput && $chk(this.target.get('value')))
@Htbaa
Htbaa / .gitconfig
Created April 27, 2011 10:31
.gitconfig
[mergetool "kdiff3"]
path = C:/Program Files (x86)/KDiff3/KDiff3.exe
[merge]
tool = kdiff3
[core]
autocrlf = true
# safecrlf = true
trustctime = false
editor = vi
[diff]