Skip to content

Instantly share code, notes, and snippets.

View lightglitch's full-sized avatar

Mário Franco lightglitch

View GitHub Profile
@DarthSim
DarthSim / 00.imgproxy_vs_alternatives.md
Last active October 19, 2025 08:46
imgproxy vs alternatives benchmark

Important

These benchmark results are outdated.

Check out our blog post for the latest benchmark results.

imgproxy vs alternatives benchmark

Setup

  • c5.xlarge AWS instance: 4 CPUs, 8 GB RAM
@JoelLisenby
JoelLisenby / export_opencart_orders.sql
Last active November 18, 2020 12:57
Queries to export customers and orders from OpenCart as CSV for Import into WooCommerce via WPImportAll plugin
/*
SQL Queries to export customers and orders from OpenCart database as CSV to import into
WooCommerce via the WP All Import plugin with the WooCommerce Add-On
http://www.wpallimport.com/
- Use wp_all_import_templates.txt with the plugin to save column matching time.
- Currently does not import order status
*/
package main
import (
"fmt"
"strings"
)
func CompareTwoStrings(stringOne, stringTwo string) float32 {
removeSpaces(&stringOne, &stringTwo)
@timurcatakli
timurcatakli / webpack.config.js
Last active May 1, 2023 18:25
An Easy to Understand Webpack 4+ Configuration File with Comments
const publicPath = 'public';
// Node os module
// The os module provides a number of operating system-related utility methods.
// It can be accessed using:
const os = require('os');
// Using a single monolithic configuration file impacts comprehension and
// removes any potential for reusability.
// As the needs of your project grow, you have to figure out the means to manage
// webpack configuration more effectively.
@filipechagas
filipechagas / block-search-nginx.conf
Created May 27, 2016 15:08
Block Search Engine Index from Nginx
add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active January 9, 2025 12:22
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@arno-di-loreto
arno-di-loreto / openapi_specification_fka_swagger_specification_tutorial.md
Last active May 5, 2022 13:46
OpenAPI Specification (fka Swagger Specification) tutorial files from [API Handyman blog](http://apihandyman.io)
@marcellodesales
marcellodesales / ec2-host-from-tag-to-env-vars.sh
Last active November 8, 2022 11:49
Create Environment Variables in EC2 Hosts from EC2 Host Tags, just like Beanstalk or Heroku does!
######
# Author: Marcello de Sales (marcello.desales@gmail.com)
# Description: Create Create Environment Variables in EC2 Hosts from EC2 Host Tags
#
### Requirements:
# * Install jq library (sudo apt-get install -y jq)
# * Install the EC2 Instance Metadata Query Tool (http://aws.amazon.com/code/1825)
#
### Installation:
# * Add the Policy EC2:DescribeTags to a User
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@jeffrainey
jeffrainey / wp_get_nav_menu_items-filter
Created August 20, 2015 18:22
Create a menu item using wp_get_nav_menu_items. This simply adds the item to the end. The cool thing it appears in the menus editor too! It would be nice to add ability to sort in the menu and remove the item using the menu editor.
// from http://www.daggerhart.com/dynamically-add-item-to-wordpress-menus/
add_filter( 'wp_get_nav_menu_items', 'custom_nav_menu_items', 20, 2 );
function custom_nav_menu_items( $items, $menu ){
// only add item to a specific menu
if ( $menu->slug == 'secondary-navigation' ){
// only add profile link if user is logged in
if ( get_current_user_id() ){