Skip to content

Instantly share code, notes, and snippets.

View ThomasLocke's full-sized avatar

Thomas Løcke ThomasLocke

View GitHub Profile
@ThomasLocke
ThomasLocke / gist:2421273
Created April 19, 2012 14:23
SQL Query with a bunch of JOIN's
SELECT "Organization".*,
"ContactEntity".ce_id,
"ContactEntity".ce_name,
"ContactEntity".isperson,
"Tag".tag_id,
"Tag".tag_name
FROM "Organization"
LEFT JOIN "ContactEntity_Organization"
ON "Organization".org_id = "ContactEntity_Organization".org_id
@ThomasLocke
ThomasLocke / gist:2428003
Created April 20, 2012 11:54
SQL_Select - the cleaner version
-------------------------------------------------------------------------------
-- --
-- dbtest --
-- --
-- Copyright (C) 2012-, AdaHeads K/S --
-- --
-- This is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 3, or (at your option) any --
-- later version. This library is distributed in the hope that it will be --
@ThomasLocke
ThomasLocke / gist:2469364
Created April 23, 2012 07:31
GNATCOLL.SQL JOIN's
with Ada.Text_IO;
with Database;
with GNATCOLL.SQL;
with GNATCOLL.SQL.Exec;
with GNATCOLL.SQL.Postgres;
with GNATCOLL.Traces;
procedure DBtest is
use Ada.Text_IO;
@ThomasLocke
ThomasLocke / gist:2604657
Created May 5, 2012 18:40
My xmonad configuration
import XMonad
import XMonad.Actions.CycleWS -- cycle thru WS', toggle last WS
import XMonad.Hooks.DynamicLog -- statusbar
import XMonad.Hooks.ManageDocks -- dock/tray mgmt
import XMonad.Util.EZConfig -- append key/mouse bindings
import XMonad.Util.Run(spawnPipe) -- spawnPipe and hPutStrLn
import System.IO
import XMonad.Actions.SpawnOn
lowerVolume = "<XF86AudioLowerVolume>"
@ThomasLocke
ThomasLocke / gist:2760937
Created May 21, 2012 07:25
JSON test object
{
"name": "Thomas Løcke",
"db_columns": {
"is_human": true,
"ce_id": 1,
"ce_name": "Thomas Løcke"
},
"type": "human",
"attributes": {
"phone": "88329100",
@ThomasLocke
ThomasLocke / gist:2835453
Created May 30, 2012 10:45
CORS header support for Ada Web Server.
From 2f858f81c4dbcbdda2cecf70153168d0868e9374 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20L=C3=B8cke?= <thomas@12boo.net>
Date: Wed, 30 May 2012 12:34:18 +0200
Subject: [PATCH 2/2] Added Cross-Origin Resource Sharing headers.
http://www.w3.org/TR/cors/
---
src/core/aws-messages.ads | 21 +++++++++++++++++++++
src/core/aws-status.adb | 29 +++++++++++++++++++++++++++++
src/core/aws-status.ads | 16 ++++++++++++++++
@ThomasLocke
ThomasLocke / gist:3004185
Created June 27, 2012 13:50
Ada Web Server patch to show WebSocket configuration parameters on the AWS status page
From d08f5587c354e8e58b837dfe2d1f8dca8d8ef376 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20L=C3=B8cke?= <thomas@12boo.net>
Date: Wed, 27 Jun 2012 15:46:27 +0200
Subject: [PATCH] Added the WebSocket configuration parameters to the AWS
status page.
---
demos/runme/aws_status.thtml | 42 +++++++++++++++++++++++++++++++++------
src/core/aws-config-set.adb | 2 +
src/core/aws-config.adb | 9 ++++++++
@ThomasLocke
ThomasLocke / gist:3074948
Created July 9, 2012 08:04
Alice v0.38 -> v0.39 changes.
diff --git a/alice.gpr b/alice.gpr
index 632389e..1e7613d 100644
--- a/alice.gpr
+++ b/alice.gpr
@@ -28,7 +28,7 @@ project Alice is
type Build_Type is ("Debug", "Production");
Build : Build_Type := External ("BUILDTYPE", "Production");
- Source_Options := ("src");
+ Source_Options := ("src", "src/handlers");
@ThomasLocke
ThomasLocke / gist:3754529
Created September 20, 2012 07:57
Ada tasking and timeouts
task body AMI_Action
is
begin
select
accept Start do
select
delay 2.0;
raise AMI_Action_Error with Connect_Timed_Out_Message;
then abort
AWS.Net.Std.Connect (Socket => Action_Socket,
@ThomasLocke
ThomasLocke / gist:3905249
Created October 17, 2012 12:20
AWS.Session test
with AWS.Session;
with AWS.Templates;
package body View.Session_Test is
---------------
-- Generate --
---------------
function Generate