View countEachChar.groovy
This file contains 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
#! /usr/bin/env | |
// Example | |
// groovy countEachChar.groovy MY_TEXTFILE > OUT_PUT_TEXT_FILE | |
def printErr = System.err.&println | |
if (args.length == 0) { | |
printErr "No path is passed as an argument! Exiting!" | |
return; |
View downloadAndSaveWebsite.groovy
This file contains 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
def content = "https://google.com".toURL().text | |
writeToFile("C:/tmp", "fhnw-job-ausschreibung", "html", content) | |
public void writeToFile(String directory, String fileName, String extension, def content) { | |
new File("$directory/$fileName.$extension").withWriter { out -> | |
out.println content | |
} | |
} |
View Spring-LoggingProvider.java
This file contains 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
import org.springframework.beans.factory.InjectionPoint; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.config.DependencyDescriptor; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Scope; | |
import org.springframework.web.context.annotation.SessionScope; | |
import org.springframework.boot.CommandLineRunner; | |
import org.springframework.boot.SpringApplication; |
View .gitconfig
This file contains 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
[core] | |
autocrlf = true | |
excludesfile = ~/.gitignore | |
[alias] | |
unstage = reset -q HEAD -- | |
discard = checkout -- | |
nevermind = !git reset --hard HEAD && git clean -d -f | |
uncommit = reset --mixed HEAD~ | |
save = commit -m | |
resave = commit --amend |
View selenium-tester.js
This file contains 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
var webdriver = require('selenium-webdriver'); | |
var keyword = "Magic"; | |
var driver = new webdriver.Builder(). | |
usingServer('http://localhost:4444/wd/hub/'). | |
withCapabilities(webdriver.Capabilities.chrome()). | |
build(); | |
driver.get('http://www.google.com'); | |
driver.findElement(webdriver.By.name('q')).sendKeys(keyword); | |
driver.findElement(webdriver.By.name('btnG')).click(); |
View useful-commands.sh
This file contains 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
# chrome commands and JS | |
## Change the playback rate of all videos on a page | |
document.querySelector('video').playbackRate = 1.2 | |
# start a jupyter notebook from any folder | |
jupyter notebook . | |
# start a minimal react-app | |
npm install -g create-react-app | |
create-react-app react-hello-world |
View commands.sh
This file contains 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
# Create the VirtualBox VM running a mini Linux with Docker (name 'default') | |
docker-machine create --driver=virtualbox | |
docker-machine create --driver virtualbox --virtualbox-hostonly-cidr "10.0.0.1/24" default | |
# See all machines | |
docker-machine ls | |
docker-machine env default | |
eval "$(docker-machine env default)" |
View EditableTableFX.java
This file contains 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
/* | |
* Just copy and paste the code. | |
*/ | |
package editabletableview; | |
import java.time.LocalDate; | |
import java.time.ZoneId; | |
import java.time.format.DateTimeFormatter; | |
import java.time.format.FormatStyle; | |
import java.util.Date; |