Skip to content

Instantly share code, notes, and snippets.

Seb Schmidt bastman

Block or report user

Report or block bastman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bastman
bastman / BlobStorageUri.kt
Created Aug 7, 2019
BlobStorageUri (kotlin, jackson)
View BlobStorageUri.kt
import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonValue
data class BlobStorageUri(
val account: String,
val container: String,
val key: String
) {
val uri: String
View psql_sslmode.sh
# https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode
$ export PGSSLMODE=prefer
$ psql ...
@bastman
bastman / Jackson.kt
Last active Apr 23, 2019
kotlin jackson patchable deserializer
View Jackson.kt
package com.example.config
import com.example.Patchable
import com.example.PatchableDeserializer
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.databind.module.SimpleModule
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import org.springframework.context.annotation.Bean
@bastman
bastman / azcopy_osx_install.sh
Created Mar 27, 2019
azcopy_osx_install.sh : download azure azcopy
View azcopy_osx_install.sh
#!/usr/bin/env bash
cd /tmp
wget -O azcopyv10.tar https://aka.ms/downloadazcopy-v10-mac
tar -xf azcopyv10.tar
cd azcopy_darwin_amd64_10.0.8
cp azcopy /usr/local/bin/
cd -
azcopy --help
@bastman
bastman / ExampleTest.kt
Last active Mar 26, 2019
junit5: Testfactory DSL (kotlin) - dynamic, nested tests ...
View ExampleTest.kt
package com.example
import com.example.testutils.junit5.testFactory
import com.example.testutils.springTest.BootWebMockMvcTest
import mu.KLogging
import org.amshove.kluent.shouldEqual
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestFactory
import org.springframework.beans.factory.annotation.Autowired
import java.math.BigDecimal
View exposed-tricks.kt
# =========
# demo: https://github.com/JetBrains/Exposed/tree/master/src/test/kotlin/demo
# dml tests: https://github.com/JetBrains/Exposed/blob/master/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/DMLTests.kt
# ===== GIS
https://github.com/JetBrains/Exposed/issues/459
# === native
@bastman
bastman / html-dom-selectors-xpath.txt
Last active Feb 27, 2019
e2e-html-dom-selectors-xpath
View html-dom-selectors-xpath.txt
document.querySelector('#region > div > div:nth-child(1) > span')
in chrome dev tools you can execute:
$x('//*[@id="region"]/div/div[1]/span')
which should be similar to ...
function getElementByXpath(path) {
@bastman
bastman / sql-Query-order-of-execution.sql
Last active Feb 19, 2019
sql - Query order of execution
View sql-Query-order-of-execution.sql
see: https://sqlbolt.com/lesson/select_queries_order_of_execution
1. FROM and JOINs
2. WHERE
3. GROUP BY
4. HAVING
5. SELECT
6. DISTINCT
7. ORDER BY
8. LIMIT / OFFSET
@bastman
bastman / postgres_copy_column.sql
Last active Feb 19, 2019
postgres: add column to table - as copy of other colum
View postgres_copy_column.sql
scenario
======================
given:
table wf_test
- wf_id (PK NOT NULL)
should become:
@bastman
bastman / public-apis.txt
Created Feb 16, 2019
public (free) apis
View public-apis.txt
https://github.com/toddmotto/public-apis
You can’t perform that action at this time.