Skip to content

Instantly share code, notes, and snippets.

View childnode's full-sized avatar

Marcel Trautwein childnode

View GitHub Profile
@childnode
childnode / 00_SetInConditionTest.cmd
Last active August 29, 2015 14:10
What is the cause for empty variables in batch files if set is used in conditon? see http://stackoverflow.com/questions/6473385 for discussion
@echo off
Set delayed=%1
If "%delayed%"=="" (
Set delayed=false
)
If %delayed%==true (
SetLocal EnableDelayedExpansion
)
echo "=============================="
@childnode
childnode / LOCALAPPDATA.fixForSYSTEMorSERVICEuser.cmd
Last active August 29, 2015 14:10
Get correct %LOCALAPPDATA% for SYSTEM user on a win64 system. http://ss64.com/nt/syntax-variables.html
Set IsSystemUser=0
If "%USERNAME%" == "SYSTEM" Set IsSystemUser=1
If "%COMPUTERNAME%$" == "%USERNAME%" Set IsSystemUser=1
If %IsSystemUser% EQU 1 (
echo "running as system user %USERNAME%";
If NOT %PROCESSOR_ARCHITECTURE% == x86 (
echo "64bit system, looking for WOW64"
IF EXIST %SYSTEMROOT%\SysWOW64\config\systemprofile\AppData\Local\NUL (
Set LOCALAPPDATA="%SYSTEMROOT%\SysWOW64\config\systemprofile\AppData\Local"
) else (
@childnode
childnode / MyDataObject.cs
Created July 23, 2015 10:47
Alphanumeric sorting in C#
/// <summary>simple Value Object</summary>
public class MyDataObject
{
public string Name { get; set; }
}
@childnode
childnode / svnBranchesAndGitSvnRebase.cmd
Created September 1, 2015 06:49
git svn rebase with branches
mkdir svn
mkdir git
svnadmin create --pre-1.4-compatible svn
svn checkout file:///%CD:\=/%/svn svninit
cd svninit
mkdir trunk branches tags
svn add trunk branches tags
svn commit -m "init"
cd ..
svn checkout file:///%CD:\=/%/svn/trunk svnco
@childnode
childnode / GenericsAndInheritanceCsharpOne.cs
Last active October 13, 2015 11:59
Generics and inheritance of classes in Java and C#
using System;
using System.Collections.Generic;
public class BaseClass
{
}
public class DerivedClassA : BaseClass
{
@childnode
childnode / Settings.yaml
Created January 16, 2013 01:51
working pdo_sqlite Setting for Flow
TYPO3:
Flow:
persistence:
backendOptions:
driver: 'pdo_sqlite'
path: '/tmp/example.sqlite'
user: 'exuser'
password: 'expass'
#core:
#phpBinaryPathAndFilename: '/usr/local/zend/bin/php-cli'
test("reposition arrow test", function () {
var tooltip = $('<a href="#" rel="tooltip" title="Simple tooltip" style="display: inline-block; position: absolute; top: 0; left: 100px;"></a>')
.appendTo('#qunit-fixture')
.tooltip({
placement: 'bottom'
})
.tooltip('show')
equal($('.tooltip').children('.tooltip-arrow').length, 1, '.tooltip-arrow is present')
equal($('.tooltip').children('.tooltip-arrow').position().left, '50%', '.tooltip-arrow positioned in the middle')
@childnode
childnode / check_JVMlevel_on_JavaCompile.gradle
Last active February 25, 2016 13:46
gradle_java_check_compiler.gradle
tasks.withType(JavaCompile) {
doFirst {
if (!JavaVersion.current().java8Compatible) {
throw new IllegalStateException("Must be built with Java 8 or higher")
}
}
// typical compileJava options
options.encoding = 'UTF-8'
}
@childnode
childnode / idea_directoryBasedConf.gradle
Created February 25, 2016 13:44
gradle idea plugin workaround for dir-based configuration #2
sourceCompatibility = JavaVersion.VERSION_1_8
// !! HAVE TO BE SET AFTER project.sourceCompatibility
idea {
project {
// explicit set to sourceCompatibility since default is JVM level that runs gradle
jdkName = project.sourceCompatibility
outputFile = new File('.idea/modules.xml')
}
}
@childnode
childnode / mock_sourceSets.gradle
Created February 26, 2016 08:36
gradle mock sourceSet
sourceSets {
mock {
java.srcDir 'src/mock/java'
output.classesDir sourceSets.main.output.classesDir
resources.srcDir 'src/mock/resources'
output.resourcesDir sourceSets.main.output.resourcesDir
}
}
compileJava.dependsOn compileMockJava
processResources.dependsOn processMockResources