Skip to content

Instantly share code, notes, and snippets.

View Gems's full-sized avatar
✏️
Typing…

Eduard Gomoliako Gems

✏️
Typing…
View GitHub Profile
@Gems
Gems / HttpClientConfigurer.java
Created April 18, 2024 06:25
HTTP Client Configurer with Default and System Store (cacerts) using io.github.hakky54:sslcontext-kickstart
import nl.altindag.ssl.SSLFactory; // io.github.hakky54:sslcontext-kickstart
@NoArgsConstructor
public class HttpClientConfigurerTrustAllCACerts implements HttpClientConfigurer {
@Override
@SneakyThrows
public void configureHttpClient(HttpClientBuilder clientBuilder) {
// val sslContext = SSLContexts.custom().loadTrustMaterial(null, (cert, authType) -> true).build();
@Gems
Gems / .java
Last active July 12, 2022 11:36
Camel onCompletion weird behavior — Unit Test
package camel.test;
import lombok.SneakyThrows;
import lombok.val;
import org.apache.camel.EndpointInject;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
@Gems
Gems / Accessor.java
Last active April 27, 2022 10:55
Non-accessible class methods accessor (Java)
class Accessor {
private static final MethodHandle methodHandle;
private static final String METHOD_NAME = "methodName";
static {
try {
val declaredMethod = Target.class.getDeclaredMethod(METHOD_NAME);
declaredMethod.setAccessible(true);
@Gems
Gems / gpg.sh
Created April 15, 2022 17:06
Git gpg that respects $GIT_COMMITTER_DATE
#!/usr/bin/env bash
LOG_FILE=/dev/null
exec > >(tee -a $LOG_FILE >&1)
exec 2> >(tee -a $LOG_FILE >&2)
if [ -n "$GIT_COMMITTER_DATE" ]; then
FST="--faked-system-time $(date -j -f '%Y-%m-%dT%H:%M:%S' $GIT_COMMITTER_DATE +'%s')"
fi
@Gems
Gems / docker-compose.sh
Last active October 20, 2023 07:38
A `docker-compose` wrapper for multiple configuration files with relative paths
#!/usr/bin/env bash
TMP_FILE=/tmp/docker-compose.$$.yaml
finish() {
rm ${TMP_FILE} ${TMP_FILE}.tmp 2>/dev/null
}
trap finish EXIT
@Gems
Gems / nginx.conf
Last active August 29, 2015 14:25
Development environment
server {
listen 80;
server_name ~^(?<domain>.+)$;
set $htdocs "/usr/local/var/www/$domain/";
root $htdocs;
index index.html;
set $auth "off";
@Gems
Gems / Markup Requirements.md
Created July 15, 2015 10:59
Требования к верстке, Фогейм

Страницы Фогейма. Общие требования к верстке.

Требования к браузерам

Последние 2-3 версии Firefox, Chrome и Opera Next, а также IE 10+ и Opera 12.1+.

Для проектов, для которых предусмотрены мобильные версии – корректная работа в iOS Safari 6.1+ и браузер по-умолчанию в Android 4+.

HTML

Стараемся использовать не только <div> и <span>, но и другие элементы в зависимости от семантики контента. Тексты предпочтительнее обрамлять в предусмотреных для этого <h?> и <p> и т. п.

IF "%1"=="%2" CALL %3 %4 %5 %6 %7 %8 %9
#!/bin/bash -e
for param in "$@"
do case $param in
--server=*)
server="${param#*=}"
;;
--token=*)
token="${param#*=}"
;;
@Gems
Gems / iterate.sh
Last active December 20, 2015 14:19
alias *="sh iterate.sh "
#!/bin/bash
path=$PWD
for dir in $path/*;
do
if [ -d $dir ]; then
echo "\033[0;33m$dir>\033[0;34m $1 $2\033[00m"
cd "$dir"
$@
fi