Skip to content

Instantly share code, notes, and snippets.

@Htbaa
Htbaa / rest-tstream.bmx
Created March 12, 2010 21:15
rest.mod TStream example
SuperStrict
Import htbaapub.rest
Local request:TRESTRequest = New TRESTRequest
Local stream:TStream = WriteStream("Moose-0.99.tar.gz")
request.SetStream(stream)
Local response:TRESTResponse = request.Call("http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Moose-0.99.tar.gz", Null, "GET")
CloseStream(stream)
@Htbaa
Htbaa / sources.json
Created March 13, 2010 23:17
Maximus sources example
{
"bah":{
"maxunit":{
"versions":{
"dev":{"url":"http://localhost:3000/module/download/bah.maxunit-dev.zip","deps":[]},
"1_02":{"url":"http://localhost:3000/module/download/bah.maxunit-1_02.zip","deps":[]},
"1_03":{"url":"http://localhost:3000/module/download/bah.maxunit-1_03.zip","deps":[]}
},
"desc":null
}
@Htbaa
Htbaa / .perltidyrc
Created July 21, 2010 12:13
.perltidyrc
# Perl Best Practices (plus errata) .perltidyrc file
-l=98 # Max line width is 98 cols
-i=4 # Indent level is 4 cols
-ci=4 # Continuation indent is 4 cols
#-st # Output to STDOUT
-se # Errors to STDERR
-vt=2 # Maximal vertical tightness
-cti=0 # No extra indentation for closing brackets
-pt=1 # Medium parenthesis tightness
-bt=1 # Medium brace tightness
@Htbaa
Htbaa / .gvimrc
Last active February 16, 2024 10:23
.gvimrc
" NOTE: a separate .vimrc is required for vim-plug: https://gist.github.com/Htbaa/b3c8d46db8936ad69c4c9bf46e55b51b
" Many thanks to https://raw.github.com/nvie/vimrc/master/vimrc
" http://nvie.com/posts/how-i-boosted-my-vim/
"set guifont="Droid Sans Mono:h10:b:cANSI"
"set guifont=Consolas:h10:b:cANSI
set number " always show line numbers
set smartindent
set hlsearch " highlight search terms
@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]
@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 / .gitignore
Created September 3, 2011 20:05
BlitzMax Indexer
*.xml
.*
!.gitignore
Makefile*
!Makefile.PL
META.yml
MYMETA.*
blib
build
/inc
@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 / 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 / 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;