Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tompazourek's full-sized avatar
👨‍💻
Busy

Tom Pažourek tompazourek

👨‍💻
Busy
View GitHub Profile
@tompazourek
tompazourek / TagBuilder.cs
Created April 7, 2014 09:46
Port of TagBuilder from ASP.NET MVC to .NET 3.5 (outside of MVC framework).
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Text;
using System.Web;
namespace MvcTagBuilder
{
@tompazourek
tompazourek / ClipboardMonitor.cs
Created April 14, 2014 17:22
Clipboard monitor
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
/// <summary>
@tompazourek
tompazourek / Program.cs
Last active August 29, 2015 14:01 — forked from nramsbottom/Program.cs
DetectUTFBom
//
// Finds and displays the filenames of all UTF8 files that contain a byte order mark
// in a specified directory tree.
//
// based on information from the following URL
//
// http://stackoverflow.com/questions/4520184/how-to-detect-the-character-encoding-of-a-text-file
//
using System;
Imports System.Diagnostics
Imports System.Globalization
Public Module Watch
Public Function Measure(Optional label As String = Nothing) As IDisposable
Return New InternalWatch(label)
End Function
Private Class InternalWatch
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include <ncurses.h>
#define DIGIT_SIZE_X 5
#define DIGIT_SIZE_Y 7
#define SPACE_SIZE 2
/**
* Steganography
* @file main.c
* @author Tomáš Pažourek
*
* @note To see various information on standard output,
* compile with 'DEBUG' preprocessor definition.
* (add '#define DEBUG' or compile with -DDEBUG flag)
*/
--
-- Homework #2 - Graph
-- ===================
--
-- Info: http://vyuka.haskell.cz/graph/
-- Author: Tomáš Pažourek
--
import Data.Function (on)
import qualified Data.Set as Set
@tompazourek
tompazourek / bower.json
Last active August 29, 2015 14:15
main-bower-files overrides
{
"name": "Example",
"private": true,
"dependencies": {
"bootstrap": "~3.3.2",
"font-awesome": "~4.2.0",
"jquery-validation": "~1.13.1",
"jquery-validation-unobtrusive": "~3.2.2",
"eonasdan-bootstrap-datetimepicker": "~3.1.3",
"smartmenus": "~0.9.7",
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace Domain.ValueObjects
{
/// <summary>
@tompazourek
tompazourek / TruncateAllTables.sql
Created March 4, 2015 11:09
Truncate all tables in the database. Source: http://stackoverflow.com/a/12719464/108374
exec sp_MSforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'
exec sp_MSforeachtable 'ALTER TABLE ? DISABLE TRIGGER ALL'
exec sp_MSforeachtable 'DELETE FROM ?'
exec sp_MSforeachtable 'ALTER TABLE ? CHECK CONSTRAINT ALL'
exec sp_MSforeachtable 'ALTER TABLE ? ENABLE TRIGGER ALL'
exec sp_MSforeachtable 'IF NOT EXISTS (SELECT *
FROM SYS.IDENTITY_COLUMNS
JOIN SYS.TABLES ON SYS.IDENTITY_COLUMNS.Object_ID = SYS.TABLES.Object_ID
WHERE SYS.TABLES.Object_ID = OBJECT_ID(''?'') AND SYS.IDENTITY_COLUMNS.Last_Value IS NULL)
AND OBJECTPROPERTY(OBJECT_ID(''?''), ''TableHasIdentity'') = 1