Skip to content

Instantly share code, notes, and snippets.

View rubenvarela's full-sized avatar

Rubén Varela rubenvarela

View GitHub Profile
@amiorin
amiorin / README.md
Last active April 12, 2025 21:19
How to configure Home Row Mods with KMonad on macOS

Intro

Karabiner and KMonad are great open source software. Don't forget to support the authors and contributors.

If you want to try home row mods on OSX, don't use Karabiner but KMonad. KMonad is harder at the beginning but then it is easier than Karabiner. Creating layers in KMonad is trivial and without drawbacks, while it is impossible in Karabiner without drawbacks.

You need to compile a PR of the project. Install https://github.com/pqrs-org/Karabiner-DriverKit-VirtualHIDDevice/releases/download/v2.1.0/Karabiner-DriverKit-VirtualHIDDevice-2.1.0.pkg

@willwade
willwade / commands.md
Last active March 31, 2025 05:04
Apple iOS Voice Control commands list. These are the default ones listed in the settings. If you are looking for the Catalina commands Ron Leblanc has compiled a great list (https://www.dropbox.com/s/stacghczr68o8az/Voice%20Control%20Commands.xlsx?dl=0)
@anthumchris
anthumchris / README.md
Last active September 25, 2022 19:04
Clear Nginx Cache

Clearing Nginx's HTTP Cache

I recently implemented Nginx HTTP content caching on our WordPress web servers to improve page load speeds and eliminate redundant, unneeded server-side page rendering. Caching the pages was relatively straightforward, but clearing the cache required a custom workaround.

Nginx comes in two versions: free and “Nginx Plus” at $2,500/year. The free version of Nginx does not offer the needed cache-clearing features of Nginx Plus, and I wasn’t comfortable paying $20,000 for 8 instances without trying to build my own solution.

Our Nginx servers run as an HTTP proxy for multiple PHP/MySQL-backed WordPress sites. The goal was to cache the dynamic PHP HTML responses in Nginx and serve the HTML pages from Nginx to avoid redundant, CPU-intensive PHP renders.

Site Cache Configuration

The example below shows how PHP response caching is configured for a site (other nginx configuration details are excluded for brevity). A cache named cachedemo-prod is defined to store cached HTML f

@balachandrapai
balachandrapai / NLPBasics.py
Last active September 26, 2020 13:58
Basics of NLP using NLTK ( tokenizing words and sentences, stop words, stemming words, Lemmatization)
from nltk.corpus import stopwords
from nltk.tokenize import sent_tokenize, word_tokenize
##Tokenizing - Splitting sentences and words from the body of text.
##Part of Speech tagging
##Corpus - Body of text, singular. Corpora is the plural of this.
##Example: A collection of medical journals.
##Lexicon - Words and their meanings.
@0xcaff
0xcaff / 0_README.md
Last active May 13, 2023 23:35
OpenVPN, rTorrent and Flood Docker Compose Configuration

The Setup

This is a docker-compose file for a simple, secure torrent setup. It includes [rTorrent] (a torrent client), [flood] (a web interface for rTorrent), [OpenVPN] (to tunnel traffic through your ISP) and a simple iptables firewall to allow rTorrent to only access the internet through a VPN.

To run everything, put your open vpn configuration file in ./vpn.ovpn and the other configuration files from this gist in a directory then go to that

@mayel
mayel / up
Created July 20, 2017 14:50
up - script to keep your Mac up-to-date (OS, Homebrew, and App Store updates) via the command line
#!/bin/sh
# up - v2 - script to keep your Mac up-to-date (OS, Homebrew, and App Store updates) via the command line
# run thus to to install: cd /usr/local/bin && curl -s -O https://gist.githubusercontent.com/mayel/c07bc0acb91824501d5bdbdc9eb7b33a/raw/08821f64c067327ea68a1a817eb43657db10f10e/up && chmod 755 /usr/local/bin/up
# and then run it anytime by simply entering the command: up
# By https://github.com/mayel based on a script by https://github.com/imwally
# homebrew
@milanboers
milanboers / clone.bash
Last active April 24, 2025 16:49
Clone all repositories of a Github user
curl -s https://api.github.com/users/milanboers/repos | grep \"clone_url\" | awk '{print $2}' | sed -e 's/"//g' -e 's/,//g' | xargs -n1 git clone
@allysonsouza
allysonsouza / .htaccess
Created May 24, 2016 13:27
Enabling PHP 7 on Hostgator trough htaccess
# Habilitar o PHP 7.0
AddHandler application/x-httpd-php70 .php
<IfModule mod_suphp.c>
suPHP_ConfigPath /opt/php70/lib
</IfModule>
@damiankloip
damiankloip / drush.fish
Created November 23, 2015 10:13
Fish Drush completion
# Drush autocompletion
#
# Place this in your ~/.config/fish/completions/ directory, or in the
# /etc/fish/completions directory to make it available for all users.
function __complete_drush
drush --early=includes/complete.inc --verbose=0 (commandline -cpo) (commandline -t 2> /dev/null) | cut -d " " -f 1
end
complete -x -c drush -d "Drush" -a "(__complete_drush)"
@moshen
moshen / init.lua
Created September 3, 2015 01:19
My hammerspoon configuration
-- Auto-reload config
function reloadConfig(files)
doReload = false
for _,file in pairs(files) do
if file:sub(-4) == ".lua" then
doReload = true
end
end
if doReload then
hs.reload()