Skip to content

Instantly share code, notes, and snippets.

View gorauskas's full-sized avatar

Jonas Gorauskas gorauskas

View GitHub Profile
@gorauskas
gorauskas / META.json
Created May 3, 2025 11:53
PG C Extension returns unexpected value
{
"name": "rgb",
"abstract": "A rgb color data type",
"description": "A Postgres RGB color datatype with btree, hash, and GiST index support ",
"version": "0.0.1",
"generated_by": "Jonas Gorauskas",
"release_status": "unstable",
"maintainer": [
"[NixGeek.Dev](https://github.com/nixgeekdev)"
],
@gorauskas
gorauskas / xml2csv.py
Created September 1, 2014 11:25
Convert StackOverflow Dumps from XML to CSV
#!/usr/bin/env python3
# coding: utf-8
import xml.etree.cElementTree as cetree
import argparse
import time
class Timer:
def __enter__(self):
@gorauskas
gorauskas / termtimer.cs
Created May 17, 2013 05:48
Here is a cool trick to show a timer that updates in place in a console window.
using System;
using System.Timers;
namespace termtimer {
class MainClass {
public static void Main(string[] args) {
Timer t = new Timer();
t.Elapsed += new ElapsedEventHandler(t_Elapsed);
@gorauskas
gorauskas / linq-to-sql-associations.cs
Created April 28, 2011 21:09
LINQ to SQL Association Mapping
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Data.Linq.Mapping;
namespace MyNS{
static void Main(string[] args) {
JobsDataContext db = new JobsDataContext("Data Source=ServerName;Initial Catalog=MSDB;Integrated Security=SSPI;");