Skip to content

Instantly share code, notes, and snippets.

Avatar
😕
Have seen some bugs...

Barlog M. barlog-m

😕
Have seen some bugs...
View GitHub Profile
@barlog-m
barlog-m / warp_wrap_fn_no_cache_example.rs
Last active Sep 23, 2020
rust warp wrap_fn no-cache filter example
View warp_wrap_fn_no_cache_example.rs
/*
[dependencies]
log = "0.4"
env_logger = "0.7"
futures = "0.3"
tokio = { version = "0.2", features = ["full"] }
warp = "0.2"
View aerospike-ce-downloader.sh
#!/bin/env bash
# https://www.aerospike.com/artifacts/aerospike-server-community/
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
VERSION="4.9.0.4"
@barlog-m
barlog-m / mongo-vs-postgres-json-aggregation.md
Last active Nov 10, 2019
MongoDB vs PostgreSQL JSON Aggregation
View mongo-vs-postgres-json-aggregation.md

MongoDB

db.spendings.insert([{
    date: ISODate("2019-04-20"),
    trx: [
    {
        name: "food",
        value: 500
    },
@barlog-m
barlog-m / build.gradle.kts
Last active Aug 23, 2019
Gradle Kotlin DSL generatePom task for create minimal pom.xml to use with eclipse.jdt.ls
View build.gradle.kts
import org.gradle.api.artifacts.maven.Conf2ScopeMappingContainer.COMPILE
import org.gradle.api.artifacts.maven.Conf2ScopeMappingContainer.PROVIDED
val javaVer = JavaVersion.VERSION_12
tasks {
task("generatePom") {
doLast {
maven.conf2ScopeMappings.apply {
addMapping(0, configurations.getByName("implementation"), COMPILE)
View ansible_list_append.yml
---
- name: append value to each string in a list
hosts: all
tasks:
- name: db
debug:
msg: "{{ groups['db'] | map('extract', hostvars, 'ansible_host') | zip_longest([], fillvalue='5432') | map('join', ':') | join(',') }}"
with_items: "{{ groups['db'] }}"
View .editorconfig
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
@barlog-m
barlog-m / BaseIntegrationTest.kt
Created Jul 18, 2018
Integration abstract class for Spring Boot and Testcontainers
View BaseIntegrationTest.kt
import bot.config.ITConfig
import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
import org.springframework.test.context.ActiveProfiles
import org.springframework.test.context.junit.jupiter.SpringExtension
import org.springframework.boot.test.util.TestPropertyValues
import org.springframework.context.ConfigurableApplicationContext
import org.springframework.context.ApplicationContextInitializer
import org.springframework.context.ApplicationListener
@barlog-m
barlog-m / build.gradle
Last active Dec 13, 2017
gradle docker image build task
View build.gradle
task docker(dependsOn: tasks.bootJar) {
def tag = 'app'
def workDir = file("$buildDir/docker")
def dockerFile = file('src/main/docker/Dockerfile')
def inputDir = file("$buildDir/libs")
doLast {
copy {
from inputDir
from dockerFile
View JAX-WS Trace and Debug
# JDK 7
-Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dump=true
-Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold=999999
# JDK 8
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dumpTreshold=999999
@barlog-m
barlog-m / package.json
Last active Dec 17, 2015
TeamCity node.js script for start build branch
View package.json
{
"name": "teamcity-build-starter",
"version": "0.0.1",
"private": true,
"dependencies": {
"node-fetch": "latest"
}
}