Skip to content

Instantly share code, notes, and snippets.

@cesarferreira
cesarferreira / RxJava.md
Last active February 2, 2022 07:28
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
@Yimiprod
Yimiprod / difference.js
Last active July 13, 2024 15:07
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
@blole
blole / win10-taskbar-never-combine-hide-labels.md
Created October 3, 2015 12:45
Make win10 taskbar buttons `Never combine, hide labels`

##Make win10 taskbar buttons Never combine, hide labels Normally, this option isn't available, and the valid options for how the taskbar button should behave are:

option registry value hide bit combine bit
Never combine 2 0 0
Combine when taskbar is full 1 0 1
Always combine, hide labels 0 1 1

These options are set in Taskbar and Start Menu Properties, accessible by right clicking the taskbar and selecting Properties.

@elanderson
elanderson / RequestResponseLoggingMiddleware.cs
Created February 7, 2017 12:46
Request Response Logging Middleware for ASP.NET Core
public class RequestResponseLoggingMiddleware
{
private readonly RequestDelegate _next;
private readonly ILogger _logger;
public RequestResponseLoggingMiddleware(RequestDelegate next,
ILoggerFactory loggerFactory)
{
_next = next;
_logger = loggerFactory
@fabd
fabd / VMRC maximize desktop area.ahk
Created January 30, 2019 13:30
Simple script to maximize the desktop area of VMware remote console, with the Windows 10 Taskbar docked to the side.
;
; VMRC "Maximizer"
;
; Simple procedure to maximize VMRC's desktop area, while keeping the Windows 10
; taskbar docked to the side. Remove the VMRC window titlebar, and the toolbar.
;
; SETUP
;
; - Set Windows Taskbar docked to the right
;
@pedrolamas
pedrolamas / docker-iptables-fix.sh
Created August 18, 2020 19:32
Script to fix Docker iptables on Synology NAS
#!/bin/bash
currentAttempt=0
totalAttempts=10
delay=15
while [ $currentAttempt -lt $totalAttempts ]
do
currentAttempt=$(( $currentAttempt + 1 ))
echo "Attempt $currentAttempt of $totalAttempts..."
@markasoftware
markasoftware / enterprise_token.rb
Last active July 23, 2024 11:13
OpenProject Enterprise mode for free
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ it doesn't show that enterprise mode is enabled in the settings, but all ################
############ enterprise mode features, such as KanBan boards, are enabled. ################
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.