Skip to content

Instantly share code, notes, and snippets.

View angelcosta's full-sized avatar
🏠
Working from home

Angel Costa angelcosta

🏠
Working from home
View GitHub Profile
@ruionwriting
ruionwriting / README.md
Last active June 19, 2024 17:59
LogiOps configuration for MX Master 3S

LogiOps configuration for MX Master 3S

LogiOps is an amazing projet - please donate.

TL;DR;

I've moved from MacOS (I also use Windows with this mouse) and I wanted to keep most of the behaviors I'm used too. Thinks that didn't work for me:

  • Gestures button dragging left/right switch desktops
  • Hold/release gestures buttom shows all apps in active desktop
@AidasK
AidasK / HowToDeleteAllCloudflareRecors.md
Last active July 20, 2024 17:55
Cloudflare delete all DNS records. Just go to cloudflare dns zones, open your browers developer console and paste this javascript code.

image

Real developers are not used to clicking, it's allways easier to write a script to do it for you.
@FreshLondon
FreshLondon / backup-s3.sh
Last active June 21, 2024 18:50
Custom backup script for CWP > Amazon S3 bucket
#!/usr/bin/bash
# CWP - Custom backup script
# Modified for external Amazon S3 buckets
# based on a backup script by ejsolutions/Teo/cynique
#
# Set the following 3 items to suit
tmp_dir=/home/backups_tmp/
s3_bucket=YOUR-BUCKET-NAME-HERE
retention=1
# -------------------
@rachids
rachids / settings.json
Last active May 23, 2024 10:28
Integrate Laragon's terminal (CMDer) to Visual Studio Code
{
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
// (1) function to get KV variables
const _ENV = () => [replace-with-namespace-name].get('_ENV');
let ENV={};
// (2) listen for a request
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
// (3) function to log to LOGDNA
@cabrerahector
cabrerahector / wordpress-sort-posts-by-views.md
Last active April 15, 2023 17:57
[WordPress Popular Posts] Adding Views column to the Posts Manage page

Adding Views column to the Posts Manage page

This Gist shows how to add a sortable Views column to the post/page/custom-post-type edit screen.

Out of the box, the script will display the Views column on both the Posts and Pages screens. You can change that by editing the $post_types_with_views_column array at the beginning of the script.

How do I add this to my site?

  1. Using the text editor of your preference, create a file called wpp-sortable-columns.php and add the contents of this script to it.
  2. Place the wpp-sortable-columns.php file in wp-content\plugins.
@slayer
slayer / cloudflare-delete-all-records.sh
Last active May 14, 2024 21:26
Delete all DNS records for specified zone
#!/bin/bash
TOKEN="xxxxxxxxxxxxxxxxxxx"
ZONE_ID=2222222222222222222222222
# EMAIL=me@gmail.com
# KEY=11111111111111111111111111
# Replace with
# -H "X-Auth-Email: ${EMAIL}" \
# -H "X-Auth-Key: ${KEY}" \
@JoelEadeDesign
JoelEadeDesign / elementor-custom-fonts.php
Created January 7, 2019 00:41
Add Custom Font Names to Elementor & GeneratePress Font Family drop-down
/* ------------------------------------
/* CUSTOM FONTS
/* ------------------------------------ */
/* ELEMENTOR */
function modify_controls( $controls_registry ) {
// First we get the fonts setting of the font control
$fonts = $controls_registry->get_control( 'font' )->get_settings( 'options' );
// Then we append the custom font family in the list of the fonts we retrieved in the previous step
$new_fonts = array_merge( [ 'Biotif' => 'system' ], $fonts );
@amanjuman
amanjuman / Sendy Nginx Config
Last active June 22, 2024 20:07
Sendy Nginx Config for PHP8.1 FPM
sudo su
//Setup Hostname
hostnamectl set-hostname subdomain.domain.tld
## Basic
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y && sudo apt-get install software-properties-common
//Setup SWAP
sudo fallocate -l 1G /swapfile;
ls -lh /swapfile;
@gbrayhan
gbrayhan / contact.html
Created June 7, 2018 05:55 — forked from ShuvoHabib/contact.html
Mailgun Contact Form
<div class="contact-form">
<form id="contactform" name="contactform" method="post">
<div class="row">
<div class="col-sm-6">
<input name="name" class="form-control" type="text" placeholder="Name*"/>
</div>
<div class="col-sm-6">
<input name="email" class="form-control" type="email" placeholder="Email*"/>
</div>
<div class="clearfix"></div>