Skip to content

Instantly share code, notes, and snippets.

View barlog-m's full-sized avatar
😕
Have seen some bugs...

Barlog M. barlog-m

😕
Have seen some bugs...
View GitHub Profile
@barlog-m
barlog-m / bevy-ambient-light-example.rs
Created March 21, 2024 13:53
Bevy ambient light question
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.insert_resource(AmbientLight {
color: Color::default(),
brightness: 0.02,
})
.add_systems(Startup, setup)
/*
[dependencies]
futures = "0.3"
tokio = { version = "1", features = ["full"] }
rand = "0.8"
*/
use std::sync::Arc;
use rand::prelude::*;
@barlog-m
barlog-m / warp_wrap_fn_no_cache_example.rs
Last active September 23, 2020 17:52
rust warp wrap_fn no-cache filter example
/*
[dependencies]
log = "0.4"
env_logger = "0.7"
futures = "0.3"
tokio = { version = "0.2", features = ["full"] }
warp = "0.2"
#!/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 November 10, 2019 18:25
MongoDB vs PostgreSQL JSON Aggregation

MongoDB

db.spendings.insert([{
    date: ISODate("2019-04-20"),
    trx: [
    {
        name: "food",
        value: 500
    },
@barlog-m
barlog-m / build.gradle.kts
Last active August 23, 2019 13:33
Gradle Kotlin DSL generatePom task for create minimal pom.xml to use with eclipse.jdt.ls
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)
---
- 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'] }}"
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 July 18, 2018 20:35
Integration abstract class for Spring Boot and Testcontainers
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 December 13, 2017 14:37
gradle docker image build task
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