Skip to content

Instantly share code, notes, and snippets.

@mrcomoraes
mrcomoraes / clear_cache_MS_Teams.sh
Last active May 10, 2024 12:07
Clear cache Microsoft Teams on Linux
#!/bin/bash
# This script cleans all cache for Microsoft Teams on Linux
# Tested on Ubuntu-like, Debian by @necrifede, Arch Linux by @lucas-dclrcq and Manjaro with flatpak by @danie1k. Feel free to test/use in other distributions.
# Tested Teams via snap package.
# Tested Teams via flatpak package.
#
# How to use in terminal:
# ./clear_cache_MS_Teams.sh ( deb-stable | deb-insider | snap | flatpak )
# or
@BurakBoz
BurakBoz / urlSafeBase64.php
Last active July 2, 2023 20:17
RFC Compliant URL Safe Base64 Encode and Decode functions for php
<?php
function urlsafe_base64_encode($string)
{
return str_replace(['+','/','='], ['-','_',''], base64_encode($string));
}
function urlsafe_base64_decode($string)
{
$string = str_replace(['-','_'], ['+','/'], $string);
$mod4 = strlen($string) % 4;
@thiagomarini
thiagomarini / readme.sh
Created October 29, 2018 16:10
How to install supervisor on Amazon Linux
# Install it as a yum package instead of throgh pip (will save you from lots of hassle)
# first get epel
sudo amazon-linux-extras install epel
# then install supervisor
sudo yum install supervisor
@helgatheviking
helgatheviking / kia_convert_country_code.php
Created December 7, 2015 19:01
Converts the WooCommerce country codes to 3-letter ISO codes
<?php
/**
* Converts the WooCommerce country codes to 3-letter ISO codes
* https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
* @param string WooCommerce's 2 letter country code
* @return string ISO 3-letter country code
*/
function kia_convert_country_code( $country ) {
$countries = array(
'AF' => 'AFG', //Afghanistan
@fucha-co
fucha-co / snippet.txt
Created August 6, 2012 06:16
CSS: Bootstrap Centre Navbar
.center.navbar .nav,
.center.navbar .nav > li {
float:none;
display:inline-block;
*display:inline; /* ie7 fix */
*zoom:1; /* hasLayout ie7 trigger */
vertical-align: top;
}
.center .navbar-inner {
@hakre
hakre / change-admin-url.php
Created November 16, 2010 00:37
Change Admin URL
<?php
/**
* Change Admin URL
*
* Copyright (C) 2010 hakre <http://hakre.wordpress.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
@SamWM
SamWM / gist:266176
Created December 30, 2009 16:49
jQuery UI Image Dialog (to replace thickbox)
$("a.thickbox").click(
function(e) {
e.preventDefault();
var link = this;
var $loading = $("<div></div>").dialog({ title: "Loading..." });
$("<img>").attr({ "src": this.href }).css({ "padding": 0 }).load(
function() {
$loading.dialog("destroy").remove();
var maxWidth = $(window).width() - 20;
var maxHeight = $(window).height() - 20;