Skip to content

Instantly share code, notes, and snippets.

View mishin's full-sized avatar
💭
if you fail to prepare you prepare to fail

Nikolay Mishin mishin

💭
if you fail to prepare you prepare to fail
View GitHub Profile
@mahenzon
mahenzon / main.py
Created November 23, 2021 18:13
Python + gspread demo
import string
from pprint import pprint
import gspread
from gspread import Cell, Client, Spreadsheet, Worksheet
from gspread.utils import rowcol_to_a1
import requests
SPREADSHEET_URL = "https://docs.google.com/spreadsheets/d/.../"
" Мой актуальный конфиг тут: https://github.com/alexey-goloburdin/dotfiles
@aimtiaz11
aimtiaz11 / _readme.md
Last active January 27, 2022 23:21
Compare Properties Files Using Groovy

Compare application properties files in Groovy

This script below allows you to compare properties files between environments.

If you maintain your application's externalised properties file in a seperate repository with a structure similar to below, you can use this to compare properties file between different environment.

compare-properties.groovy
|- src
|	|- main
|	|	|- resources
program="BEGIN{prev = \"\"} \
\
/^# file: / {\
prev = substr(\$0, 9)\
}\
\
/$2/ {\
print prev;\
prev=\"\"\
}\
@Maxlero
Maxlero / build.gradle
Created March 9, 2019 12:08
Build Gradle script that generates jar file with manifest classpath pointing to dependencies in subfolder /lib. (gradle, groovy, kotlin, spring)
plugins {
id 'org.hidetake.ssh' version '2.9.0'
id 'org.jetbrains.kotlin.jvm' version '1.3.11'
id 'org.springframework.boot' version '2.1.2.RELEASE'
id 'io.spring.dependency-management' version "1.0.6.RELEASE"
}
group 'App Group'
version '1.0.0'
function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},
@dsyer
dsyer / config-props.md
Created November 2, 2017 10:25
Notes on Dynamic Configuration Properties

Dynamic Configuration Properties in Spring Boot and Spring Cloud

TL;DR

  • Use @ConfigurationProperties and always get state from the bean.
  • The Environment can change at runtime and Spring Cloud does this for you using RefreshEvent.
  • Changes are propagated to beans in Spring Cloud in 2 ways (@ConfigurationProperties and @RefreshScope).
  • If you care about the state of @ConfigurationProperties being consistent on concurrent access, put it or the consumer @Bean in @RefreshScope.

Typical Scenarios

@mishin
mishin / test.puml
Last active May 29, 2018 17:47
test.puml
@startuml
skinparam lifelineStrategy solid
skinparam handwritten false
skinparam monochrome true
skinparam packageStyle rect
skinparam defaultFontName FG Virgil
skinparam shadowing true
skinparam classBorderThickness .5
skinparam usecaseBorderThickness .5
skinparam titleBorderRoundCorner 15
#!/usr/bin/perl
use v5.14;
my $input_string;
say "Hello! Input string as \"x + y\" or \"sin x\" \n";
say 'You can use "+", "-", "*", "\", "**", "sin", "cos", "tan"';
$input_string = <STDIN>;
my ($first_arg, $second_arg, $third_arg) = split ' ', $input_string;
@klaaspieter
klaaspieter / ASS.md
Created June 22, 2017 07:59 — forked from anonymous/ASS.md
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.