This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private Stream<String> regexPatternMatchStream(final String pattern, final String target) { | |
| final Matcher matcher = Pattern.compile(pattern).matcher(target); | |
| final Stream.Builder<String> sb = Stream.builder(); | |
| while (matcher.find()) { | |
| sb.add(matcher.group()); | |
| } | |
| return sb.build(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Script generating images from HEX values | |
| .DESCRIPTION | |
| Given a CSV dump of id's, usernames, and image data (HEX value of a VARBINARY field in SQL Server), generate a jpeg image for each row of csv data and also create a new csv file that lists the path of each image. | |
| .EXAMPLE | |
| hexPhotos.ps1 -f '.\db-dump.csv' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function List-GitRepos { | |
| <# | |
| .SYNOPSIS | |
| List local Git repositories | |
| .DESCRIPTION | |
| Use this command to find Git repositories in the specified folder. It is assumed that you have the Git command line tools already installed. | |
| .PARAMETER Path | |
| The top level path to search. | |
| .EXAMPLE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [color] | |
| branch = auto | |
| diff = auto | |
| status = auto | |
| [color "branch"] | |
| current = yellow reverse | |
| local = yellow | |
| remote = green | |
| [color "diff"] | |
| meta = yellow bold |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # either ~/.bashrc or ~/.bash_profile | |
| # | |
| # | |
| # User specific aliases and functions | |
| alias du='du -kshc' | |
| alias ls='ls -lhaGF --color' | |
| export GOPATH=$HOME/.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Today I did a quick google search to see if any emulators had been written in Java. As it urns out there was a Sega Megadrive emulator called [jEnesis](http://www.workingdesign.de/projects/jenesis.php) that was written by Stephan Dittrich and released back in 2006. | |
| Most of the site is just dead links now and I wasn't able to find a working download there but I was able to track down a build of the project else where. Unfortunately however, the build I found was version 0.0.5 from May 2006 so it doesn't include the changes that went into the final v0.1.0 that was supposed to have been built in June 2006 (perhaps it was never made public). | |
| The jEnesis.jar that I downloaded depends on a very old [lwjgl](https://www.lwjgl.org/). The timestamp for the file was December 2005 which would make it [version 0.99](https://sourceforge.net/projects/java-game-lib/files/Official%20Releases/LWJGL%200.99/). | |
| This old lwjgl only supported 32-bit systems, so running `java -cp jEnesis.jar;lwjgl.jar jenesis.Main` would throw a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $baseUrl = 'http://api.domain.com/some-service/' | |
| Get-ChildItem -Path ".\*.jpg" | Sort-Object Name | % { | |
| $response = try { | |
| Invoke-RestMethod -uri "$baseUrl/image" -Method Post -Infile $_.Name -ContentType 'image/jpeg' -ErrorAction Stop | |
| } catch [System.Net.WebException] { | |
| Write-Error "Media Service returned $($_.Exception.Response.StatusCode.Value__) : $($_.Exception.Message)" | |
| Exit 1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| Deployment Script (SingingBush, 9-may-2014) | |
| Usage: | |
| In TeamCity 'Buildstep: Powershell' make sure that script is set to file and | |
| in 'Failure Conditions' the checkbox is ticked for: 'the build process exit code is not zero'. | |
| YOU MUST ENSURE THAT ALL THE FOLLOWING ARGS ARE USED: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Amazon Linux with Amazon Corretto and the aws-cli tools for use in the UK (Amazon Linux uses yum) | |
| FROM amazon/aws-cli:latest | |
| # Set the default region for aws-cli | |
| RUN mkdir /root/.aws && echo -e "[default]\nregion = eu-west-1" >> /root/.aws/config | |
| # Set the locale to UK | |
| ENV LANG en_GB.UTF-8 | |
| ENV LANGUAGE en_GB:en | |
| ENV LC_ALL en_GB.UTF-8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // This is a variation of the example found in the Bouncy Castle Java examples on github. | |
| // I'm using a public key provided by 3rd party to encrypt a file before sending to them. They | |
| // have the private key so it's a one-way system, I have no need for a decrypt method. This is | |
| // being used in a Spring Boot app, hence the annotations. | |
| // | |
| import org.bouncycastle.bcpg.CompressionAlgorithmTags; | |
| import org.bouncycastle.jce.provider.BouncyCastleProvider; | |
| import org.bouncycastle.openpgp.*; |
OlderNewer