Skip to content

Instantly share code, notes, and snippets.

@mysteriouss
mysteriouss / key-remap.md
Last active December 7, 2023 18:58
M1 MacBook Air F5 & F6 KeyRemap
#!/bin/sh

## xref: https://www.reddit.com/r/MacOS/comments/jy5ry8/m1_macbook_air_keysshortcut_for_keyboard/ghryk3j/?utm_source=reddit&utm_medium=web2x&context=3

cat > ~/Library/LaunchAgents/com.local.KeyRemapping.plist << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
@arafathusayn
arafathusayn / hidetidio.js
Last active May 7, 2024 23:42
Hide TidioChat Branding (for new theme)
function hideTdo() {
var timer = null;
var target = document.querySelector('#tidio-chat iframe');
if(!target) {
if(timer !== null) {
clearTimeout(timer);
}
timer = setTimeout(hideTdo, 500);
return;
} else {
@nicomollet
nicomollet / polylang-langswitcher-shortcode.php
Last active January 17, 2024 11:25
Polylang shortcode for lang switcher
<?php
/**
* Polylang Shortcode - https://wordpress.org/plugins/polylang/
* Add this code in your functions.php
* Put shortcode [polylang_langswitcher] to post/page for display flags
*
* @return string
*/
function custom_polylang_langswitcher() {
$output = '';
@vielhuber
vielhuber / functions.php
Created December 29, 2017 21:16
#wordpress polylang disable language in frontend
<?php
if( !is_admin() && $pagenow != 'wp-login.php' && pll_current_language() == 'en' )
{
wp_redirect(site_url().'/de/');
die();
}
@justinatack
justinatack / letsencrypt.md
Last active December 13, 2018 08:21
Installing Let's Encrypt with Cerbot on Vultr & ServerPilot

Let's Encrypt

SSH as root into the server

ssh root@SERVER_IP_ADDRESS

Install Certbot

$ sudo apt-get update
$ sudo apt-get install software-properties-common
// import_json_appsscript.js
// https://gist.github.com/allenyllee/c764c86ed722417948fc256b7a5077c4
//
// Changelog:
// (Oct. 16 2019) tag: allenyllee-20191016
// 1. Fixed google script error: urlfetchapp - service invoked too many times https://stackoverflow.com/questions/10598179/google-apps-script-urlfetchapp-service-invoked-too-many-times
// (Jul. 16 2018) tag: allenyllee-20180716
// 1. Fixed the issue "If you try to query /arrayA[k]/arrayB[n]/arrayC[m]/.../member, you will always get /arrayA[k]/arrayB[k]/arrayC[k]/.../member."
// (Nov. 30 2017) tag: allenyllee-20171130
// 1. Add the ability to query array elements by using xpath like "/array[n]/member" where "n" is array index
@arafathusayn
arafathusayn / hidetdo.js
Last active February 21, 2021 08:47
Hide Tidio Chat Branding (Old Theme). For new theme, check: https://gist.github.com/arafathusayn/663217f383b02017d20be6ba465959d4
function hideTdo() {
var timer = null;
var target = document.querySelector('#tidio-chat iframe');
if(!target) {
if(timer !== null) {
clearTimeout(timer);
}
timer = setTimeout(hideTdo, 500);
return;
} else {