Skip to content

Instantly share code, notes, and snippets.

View gorauskas's full-sized avatar

Jonas Gorauskas gorauskas

View GitHub Profile
@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;");