Skip to content

Instantly share code, notes, and snippets.

View calogxro's full-sized avatar

calogxro

View GitHub Profile
@aldobongio
aldobongio / ZuulConfiguration.java
Created August 18, 2021 14:12
Fix for Spring Boot 2.5.x + Zuul - NoSuchMethodError: ErrorController.getErrorPath()
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.cglib.proxy.Callback;
import org.springframework.cglib.proxy.CallbackFilter;
import org.springframework.cglib.proxy.Enhancer;
@guibranco
guibranco / Dockerfile
Last active March 4, 2024 11:17
Docker file for PHP 5.6 with Apache, MySQL extension, GD2 and Apache mod_rewrite enabled
FROM php:5.6-apache
RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \
-e 's|security.debian.org|archive.debian.org/|g' \
-e '/stretch-updates/d' /etc/apt/sources.list
RUN apt-get update
RUN apt-get install --yes --force-yes cron g++ gettext libicu-dev openssl libc-client-dev libkrb5-dev libxml2-dev libfreetype6-dev libgd-dev libmcrypt-dev bzip2 libbz2-dev libtidy-dev libcurl4-openssl-dev libz-dev libmemcached-dev libxslt-dev
RUN a2enmod rewrite
@vsubhash
vsubhash / com.vsubhash.js.YoutubeLite.user.js
Created July 7, 2020 18:49
Loads a lite version of Youtube and adds RSS, links to video pages, and downloads for video and subtitles. (Youtube stopped support for old versions of Firefox.) This script supersedes that of Youtube Annoyance Remover.
// ==UserScript==
// @name YoutubeLite
// @namespace com.vsubhash.js.YoutubeLite
// @description Loads a lite version of Youtube, adds video file downloads and subtitle links
// @include https://www.youtube.com/watch*
// @version 2020.07.07
// @grant none
// ==/UserScript==
@YumaInaura
YumaInaura / 00_README.md
Last active July 22, 2023 03:58
Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

I was so confused to understand behaviior of Golang channels, buffer, blocking, deadlocking and groutines.

I read Go by Example topics.

@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active April 29, 2024 03:51
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@estk
estk / main.go
Created December 14, 2016 21:12
A Tour of Go: Web Crawler Solution
package main
import (
"fmt"
"sync"
)
type Crawler struct {
crawled map[string]bool
mux sync.Mutex
@nepsilon
nepsilon / how-to-git-patch-diff.md
Last active April 19, 2024 13:33
How to generate and apply patches with git? — First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff > some-changes.patch
@butlerblog
butlerblog / wp_config.php
Last active February 1, 2024 09:00
Configure WordPress #wp_mail function to send through #SMTP server https://b.utler.co/Y3
<?php
/*
* Set the following constants in wp-config.php.
* These should be added somewhere BEFORE the constant ABSPATH is defined.
*
* Author: Chad Butler
* Author URI: https://butlerblog.com
*
* For more information and instructions, see: https://b.utler.co/Y3
@tkambler
tkambler / gist:71050d80f1a57ea83c18
Last active April 22, 2024 19:23
Calculate size of used LocalStorage space
/**
* Returns the total amount of disk space used (in MB) by localStorage for the current domain.
*/
var getLocalStorageSize = function() {
var total = 0;
for (var x in localStorage) {
// Value is multiplied by 2 due to data being stored in `utf-16` format, which requires twice the space.
var amount = (localStorage[x].length * 2) / 1024 / 1024;
total += amount;
}