Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

;*******************************************************************************
; Information
;*******************************************************************************
; AutoHotkey Version: 3.x
; Language: English
; Platform: XP/Vista/7
; Updated by: Toby Garcia
; Previously updated by: Ty Myrick
; Author: Lowell Heddings (How-To Geek)
; URL: http://lifehacker.com/5175724/.....gmail-keys
@mattanja
mattanja / dovecot-untrash-all
Last active November 19, 2015 13:04
Rename all files in a dovecot Maildir removing the "T" flag (T=Trash)
#!/bin/bash
#
# (c) 2015 Mattanja Kern <mattanjakern.de>
#
# DOVECOT Maildir remove T="Trash" flag from all files in folders.
#
removeTrashFromFileName() {
rename 's/(.+),ST$/$1,S/' "$1"
rename 's/(.+),RST$/$1,RS/' "$1"
DECLARE @datestring [nvarchar](10) = CONVERT(nvarchar, GETDATE(), 126);
DECLARE @filepath [nvarchar](max) = N'C:\Data\BackupDatabase\' + @datestring + N'-DBNAME.bak';
SELECT @filepath;
BACKUP DATABASE [DBNAME]
TO DISK = @filepath
WITH NOFORMAT, INIT, NAME = N'DBNAME-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
#!/bin/bash
#
# (c) 2007 Mattanja Kern <mattanjakern.de>
#
#USAGE="Usage: mkchmod"
USAGE="Usage: mkchmod [dirmode [filemode]]"
if [ "$1" = "" ] ; then
echo $USAGE
#!/bin/sh
### BEGIN INIT INFO
# Provides: php-5.3.29-fpm
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php-5.3.29-fpm
# Description: Starts The PHP FastCGI Process Manager Daemon
### END INIT INFO
<!DOCTYPE html>
<html>
<head>
<link data-require="bootstrap@*" data-semver="3.3.5" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
<link rel="stylesheet" href="style.css" />
<style>
/*
$color1: #aa0000; //rgba(170, 0, 0, 100)
$color2: #faa916; //rgba(250, 169, 22, 100)
$color3: #fbfffe; //rgba(251, 255, 254, 100)
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
choco install putty
choco install SublimeText3
choco install 7zip
choco install ruby
choco install TortoiseGit
choco install Cmder
choco install git.install
@mattanja
mattanja / SampleController-angular-dialog-service.js
Created October 29, 2014 09:24
Usage of angular-dialog-service
xxx.controller('MyController', ['$scope', 'dialogs', function($scope, dialogs) {
$scope.remove = function() {
dialogs.confirm('Please confirm', 'Are you sure you want to remove this item?')
.result.then(function(btn) {
// Confirmed action
}, function(btn) {
// Cancel action
});
};
}]);
@mattanja
mattanja / Controller.cs
Last active December 12, 2015 04:39
Typesafe viewmodel for MVC frameworks
public abstract class BaseController : Controller {
/// <summary>
/// Setup default page model properties.
/// </summary>
protected ViewBase<TContent> GetDefaultModel<TContent>(ViewBase<TContent> model = null) where TContent : ContentBase
{
if (model == null)
{
model = new ViewBase<TContent>();
}
@mattanja
mattanja / MyServiceTest.cs
Created October 16, 2012 13:20
Using log4net TestContextAppender
namespace MyTests
{
[TestClass()]
public class IParameterServiceTest
{
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.