Skip to content

Instantly share code, notes, and snippets.

View 166MMX's full-sized avatar

Johannes Harth 166MMX

View GitHub Profile
@166MMX
166MMX / gist:fc8bc5376ba92c03908a0e6724e615f6
Last active December 8, 2017 09:38
list all svn authors of an svn repository
# list all commit authors
SVN_URL=""; svn log --quiet --xml "$SVN_URL" | xmlstarlet select --template --value-of '/log/logentry/author/text()' | sort | uniq
# list first and last commit times of given author
SVN_AUTHOR="" SVN_URL=""; svn log --quiet "$SVN_URL" | awk 'BEGIN {FS=" \\| "} $2 == "'"$SVN_AUTHOR"'" {print $3}' | sed -e 1b -e '$!d'
# list commit count of given author
SVN_AUTHOR="" SVN_URL=""; svn log --quiet "$SVN_URL" | awk 'BEGIN {FS=" \\| "} $2 == "'"$SVN_AUTHOR"'" {print}' | wc -l
@166MMX
166MMX / com.initvoid.log.runtime.plist
Last active December 3, 2017 13:39
Create a persistent runtime log file *with duplicates*
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist>
<dict>
<key>Label</key>
<string>com.initvoid.log.runtime</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/grep</string>
<string>--no-filename</string>
@166MMX
166MMX / 10.12.csv
Last active December 29, 2017 07:23
bundleDisplayName bundleShortVersionString itemId softwareVersionBundleId softwareVersionExternalIdentifier ProductVersion ProductBuildVersion
Install macOS Sierra 1127487414 com.apple.InstallAssistant.Sierra 817891742
Install macOS Sierra 1127487414 com.apple.InstallAssistant.Sierra 818657038
Install macOS Sierra 1127487414 com.apple.InstallAssistant.Sierra 818744109
Install macOS Sierra 1127487414 com.apple.InstallAssistant.Sierra 818745269
Install macOS Sierra 1127487414 com.apple.InstallAssistant.Sierra 818758005
Install macOS Sierra 1127487414 com.apple.InstallAssistant.Sierra 818806283
Install macOS Sierra 1127487414 com.apple.InstallAssistant.Sierra 818872651
Install macOS Sierra 1127487414 com.apple.InstallAssistant.Sierra 818907548
Install macOS Sierra 1127487414 com.apple.InstallAssistant.Sierra 819278692
/^(?!\n)(\s*)#/ => '$1//'
/u"(([^"]|\\")*)"/ => "'$1'"
/(if|while|for|elif|except)\s+([^\n{]+):/ => '$1 ($2):'
/:\s*\n((\s+)[^\n]*?\n+(\n*\2[^\n]*\n)*)/ => '{\n$1}'
/raise/ => 'throw new'
/except/ => 'catch'
/elif/ => 'else if'
import java.nio.ByteBuffer
import java.nio.channels.SeekableByteChannel
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
import java.security.SecureRandom
class FileFuzzer {
private static final Random random = new SecureRandom()
<root xsi:schemaLocation="
http://www.w3.org/1999/XSL/Format http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-2_2/fop/src/foschema/fop.xsd
http://www.w3.org/1998/Math/MathML https://www.w3.org/Math/DTD/mathml2/mathml2.dtd
"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
jar {
final fileTree = fileTree('src/main/resources')
final rootDir = fileTree.dir.toPath()
for (file in fileTree) {
if (file.isDirectory()) {
continue
}
final name = rootDir.relativize(file.toPath()).toString()
if (name.length() <= 4) {
continue
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.edu.sc.seis:macAppBundle:2.1.5"
}
}
@166MMX
166MMX / build.gradle
Created April 20, 2017 18:38
Spring Boot without DependencyManagementPlugin
buildscript {
ext {
springBootVersion = '1.5.2.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
// http://mvnrepository.com/artifact/org.springframework.boot/spring-boot-gradle-plugin
classpath group: 'org.springframework.boot', name: 'spring-boot-gradle-plugin', version: springBootVersion