Skip to content

Instantly share code, notes, and snippets.

View Sebazzz's full-sized avatar
🏃‍♂️
Busy busy busy...

Sebastiaan Dammann Sebazzz

🏃‍♂️
Busy busy busy...
View GitHub Profile
@Sebazzz
Sebazzz / default
Created July 29, 2012 09:33
My PXELINUX configuration
# Set-up menu as default
DEFAULT vesamenu.c32
PROMPT 0
# Menu config
MENU INCLUDE pxelinux.cfg/graphics.conf
MENU TITLE ReadyNAS PXE Boot Menu
MENU BACKGROUND pxelinux.cfg/background.png
# Function Keys
@Sebazzz
Sebazzz / DisposablePattern.DotSettings
Created August 24, 2012 18:18
Disposable Pattern
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=8E61C859EB76F74A941E057B7CA12454/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=8E61C859EB76F74A941E057B7CA12454/Shortcut/@EntryValue">DisposablePattern</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=8E61C859EB76F74A941E057B7CA12454/Description/@EntryValue">Skeleton implementation for Disposable pattern</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=8E61C859EB76F74A941E057B7CA12454/Text/@EntryValue">private bool disposed;&#xD;
&#xD;
/// &lt;summary&gt;&#xD;
/// Releases unmanaged resources and performs other cleanup operations before t
@Sebazzz
Sebazzz / MegaAnimatedSprite.java
Created September 27, 2012 10:10
Helper class for animating large sprites
package org.sebazzz.anddev;
import org.andengine.entity.Entity;
import org.andengine.entity.sprite.Sprite;
import android.util.Log;
import android.util.SparseArray;
/**
* Represents a sprite that supports displaying several large textures for animation
@Sebazzz
Sebazzz / gist:5151351
Created March 13, 2013 11:45
Stacktrace NancyFx Crash
Server Error in '/' Application.
An item with the same key has already been added.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: An item with the same key has already been added.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
@Sebazzz
Sebazzz / Run.bat
Last active September 25, 2016 09:41
ITestAction placed on assembly level does not run before and after each test fixture. Place the nunit 3 assemblies in the directory of this gist, and run 'run.bat'.
@echo off
csc Test.cs /target:library /debug+ /debug:full /reference:nunit.framework.dll
nunit3-console.exe Test.dll
@Sebazzz
Sebazzz / limetorrents.py
Created September 30, 2016 20:36
Limetorrents provider for SickGear (sickbeard)
# coding=utf-8
#
# This file is part of SickGear.
#
# SickGear is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SickGear is distributed in the hope that it will be useful,
@Sebazzz
Sebazzz / CollationBugRepro.sql
Created January 14, 2017 11:41
Repro for bug of collation issue in SQL Server 2012 (see: http://dba.stackexchange.com/q/160975/114952). Repro also on localdb v11.
/****** Object: Database [CollationTest] Script Date: 14-1-2017 12:40:46 ******/
CREATE DATABASE [CollationTest]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'CollationTest', FILENAME = N'C:\Users\Sebastiaan\CollationTest.mdf' , SIZE = 4096KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'CollationTest_log', FILENAME = N'C:\Users\Sebastiaan\CollationTest_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [CollationTest] SET COMPATIBILITY_LEVEL = 110
GO
@Sebazzz
Sebazzz / defragment-identity-fk.sql
Created January 21, 2017 11:26
Scripts to defragment (remove holes) between primary FK keys
-----------------------------------------
-- Script to "defragment" identity values in tables of the current database
--
-- Author: Sebastiaan Dammann
--
-- Global overview:
-- This script generates SQL statements you can use to remove gaps in identity
-- values in your SQL database. This script only operates on the dbo schema.
-- You can exclude tables for defragmenting via @tablesToSkip (LIKE query pattern).
--
@Sebazzz
Sebazzz / reindex-all-indexes.sql
Created January 21, 2017 12:28
SQL script to reindex all tables in your tables
DECLARE @TableName nvarchar(255)
DECLARE TableCursor CURSOR FOR
SELECT table_name FROM information_schema.tables
WHERE table_type = 'base table' And TABLE_SCHEMA = 'dbo'
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT CONCAT('Reindexing: ',@TableName,'...')
@Sebazzz
Sebazzz / config-backup.sh
Created July 22, 2017 18:39
Ubiquiti EdgeOS backup script - See: http://damsteen.nl
#!/bin/bash
DATE=$(date +%F)
TARGET_FILENAME=edgeos-backup-$DATE.tar.gz
TARGET_DIR=/tmp
TARGET_PATH=$TARGET_DIR/$TARGET_FILENAME
SOURCE_DIR=/config
DATE_OFFSET_SCRIPT=/config/user-data/date-offset.pl
BACKUP_RETENTION=3