Skip to content

Instantly share code, notes, and snippets.

View stijnsanders's full-sized avatar

Stijn Sanders stijnsanders

View GitHub Profile
@stijnsanders
stijnsanders / ebbr.json
Created December 19, 2014 14:25
ebbr.json for zlsa's atc
{
"name":"Brussels-National",
"level":"hard",
"radio":"Brussels",
"icao":"EBBR",
"wind":{
"angle":230,
"speed":5
},
"fixes":{
@stijnsanders
stijnsanders / PdfParser.pas
Created October 27, 2014 12:09
Minimal PDF parser to extract text of first page
unit PdfParser;
interface
uses SysUtils, Classes;
type
TPdfDocument=class;//forward
TPdfDataBlockType=(dbtDictionary,dbtArray,dbtSingleValue);
@stijnsanders
stijnsanders / SSCCE_arc.pas
Last active August 29, 2015 13:58
SSCCE about reference counting of TStreamAdapter's
unit SSCCE_arc;
//see also http://stackoverflow.com/questions/22846335/why-is-this-tstreamadapter-not-released
interface
procedure SSCCE_arc1;
implementation
@stijnsanders
stijnsanders / sortable.html
Created July 19, 2013 15:30
A simple straightforward sortable table in JavaScript
<style><!--
TABLE,P {padding:0.2em;}
TH {padding: 0.2em;border:1px solid green;}
TH.sorted_up {background-color:#CFC;}
TH.sorted_down {background-color:#FCC;}
TD {padding: 0.2em;border:1px solid blue;}
TD.n {text-align:right;}
//--></style>
<table id="sortable" cellspacing="0" cellpadding="2">
@stijnsanders
stijnsanders / CheckEmptySubject.vba
Created November 5, 2012 09:41
Outlook script to replace empty subjects
Private Sub CheckEmptySubject()
Dim fi
Dim mi As Object
Dim s As String
Set fi = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
If fi.Items.Count <> 0 Then
Set mi = fi.Items.Item(fi.Items.Count)
If mi.Subject = "" Then
mi.Subject = "<E-mail without subject by " & mi.SenderName & " on " & CStr(Now) & ">"
'mi.ConversationTopic
@stijnsanders
stijnsanders / chkrc.dpr
Created June 4, 2012 12:49
chkrc: Delphi pre-compiler tool to touch any rc with modified included files
program chkrc;
{$APPTYPE CONSOLE}
uses
Windows, SysUtils, Classes;
const
AppName='chkrc by Stijn Sanders <stijn@yoy.be> 2012';//version?
@stijnsanders
stijnsanders / DelphiWIATakePicture
Created February 2, 2012 16:17
Delphi: WIA to take image from digital Camera connected to USB
uses WIALib_TLB;
procedure TForm1.Button1Click(Sender: TObject);
var
wia:IWia;
wiad:OleVariant;
wiax:IWiaDispatchItem;
i:integer;
tc1,tc2:cardinal;
begin