Skip to content

Instantly share code, notes, and snippets.

View Manjago's full-sized avatar

Kirill Temnenkov Manjago

View GitHub Profile
@starlinq
starlinq / cloud.mail.ru-webdav-ubuntu-20.04.md
Last active February 9, 2024 18:38
Подключение к Cloud.mail.ru с помощью WebDAV эмулятора в Убунту 20.04
title date
Подключение к Cloud.mail.ru с помощью WebDAV эмулятора в Убунту 20.04
2020-10-16

Подключение к Cloud.mail.ru с помощью WebDAV эмулятора в Убунту 20.04

Инструкцию для Убунту 18.04 см. здесь.

@kilian-gebhardt
kilian-gebhardt / MinMaxHeap.py
Last active May 19, 2024 11:55
Min-max heap in Python
class MinMaxHeap(object):
"""
Implementation of a Min-max heap following Atkinson, Sack, Santoro, and
Strothotte (1986): https://doi.org/10.1145/6617.6621
"""
def __init__(self, reserve=0):
self.a = [None] * reserve
self.size = 0
def __len__(self):
@tluyben
tluyben / Forth1.cs
Last active April 7, 2024 22:00
A minimal Forth implementation in C#
/*
* Minimal .NET Forth implementation. Just an experiment. Do not use for anything serious.
* by Tycho Luyben (https://github.com/tluyben)
*
* The only 'primitive' (built-in) is an foreign function interface word which allows you to define
* whatever is needed, for example:
*
* hello System.String System.Console.WriteLine ffi
*
* will print hello.
@hang321
hang321 / UrlFailoverRequestInterceptor.java
Created September 13, 2016 01:28
Spring REST client failover to host
package net.hang321.http.client;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URI;
import java.util.LinkedHashSet;
import java.util.Set;
import org.slf4j.Logger;
@erickok
erickok / OkHttpGzippedLoggingInterceptor.java
Last active February 14, 2024 06:27
Simple logging interceptor for OkHttp that logs full request headers and response headers + body (useful for use with Retrofit 2 where logging was removed)
if (BuildConfig.DEBUG) {
httpclient.interceptors().add(new LoggingInterceptor());
}
public class LoggingInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
long t1 = System.nanoTime();
@salomvary
salomvary / datetime.java
Last active January 21, 2022 23:23
Java 8 Date and Time Parsing and Formatting Microtutorial
import java.time.format.DateTimeFormatter;
import java.time.Instant;
import java.time.ZonedDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
Instant.now();
// java.time.Instant = 2015-08-13T09:28:27.141Z
DateTimeFormatter.ISO_INSTANT.format(Instant.now());
@dlisin
dlisin / ActorSystemFactoryBean.java
Last active August 13, 2017 10:55
Spring FactoryBean implementation for Akka ActorSystem
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import java.util.Properties;
import akka.actor.ActorSystem;
/**
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@staltz
staltz / introrx.md
Last active June 6, 2024 03:19
The introduction to Reactive Programming you've been missing
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active June 7, 2024 01:58
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName