Skip to content

Instantly share code, notes, and snippets.

View leodutra's full-sized avatar
🦙
Llama and other LLMs

Leo Dutra leodutra

🦙
Llama and other LLMs
View GitHub Profile
@leodutra
leodutra / delete-recursively.bat
Last active May 1, 2023 19:09
Batch for deleting files and folders recursively on Windows.
@echo off
set foldername=%1
:: Remove files before removing their folders. It's faster
DEL /F /Q /S %foldername%\*
:: "RD" is much more fast than "RMDIR"
for /D %%i in ("%foldername%\*") do RD /S /Q "%%i"

Immediatly

xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"

Every reboot:

Create ~/.Xmodmap:

pointer = 1 0 3 4 5 6 7 8 9 10
@leodutra
leodutra / first-input-focus.js
Last active August 29, 2015 14:19
Focus first form input field using jQuery
function focusFirstInput($root) {
$(':input', $root).not('[type="hidden"], button').first().focus();
}
@leodutra
leodutra / what-is-installed.sh
Last active August 19, 2021 17:58
List details of installed software on Linux
#http://askubuntu.com/questions/17823/how-to-list-all-installed-packages
apt --installed list
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n
#dpkg --get-selections > ~/InstalledPackages.list
#or
dpkg --get-selections | grep -v deinstall
#To save that list to a text file called packages on your desktop do this in your terminal:
@leodutra
leodutra / ubuntu-14.04-netspeed-indicator.sh
Created April 28, 2015 22:47
Netspeed indicator for Ubuntu 14.04
# http://www.edivaldobrito.com.br/como-instalar-o-applet-netspeed-indicator-ubuntu-14-04/
add-apt-repository ppa:nilarimogard/webupd8
apt-get update
apt-get install indicator-netspeed
@leodutra
leodutra / force-no-cache.jsp
Last active January 21, 2020 22:50
Cache - Control, Pragma, Expires, must-revalidate, no-store, no-cache Stuff (force)
<%-- https://www.mnot.net/cache_docs/ --%>
<%-- http://www.mobify.com/blog/beginners-guide-to-http-cache-headers/ --%>
<%-- http://stackoverflow.com/a/18516720/1260526 --%>
<%-- https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching --%>
<%-- http://stackoverflow.com/questions/18148884/difference-between-no-cache-and-must-revalidate --%>
<%-- http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers --%>
<meta http-equiv="Cache-Control" content="no-store, must-revalidate" />
<%--OPTIONS most badly, see http://stackoverflow.com/a/18516720/1260526
@leodutra
leodutra / remove-backup-tilde-linux.sh
Created May 10, 2015 00:15
Remove GEdit Linux Text Editor Tilde Backup Files (ended with "~")
cd /home
rm -i `find -name '*~'`
@leodutra
leodutra / JNDIURLAccessTag.java
Last active August 29, 2015 14:21
JNDI URL Lookup TagLib para WAS6
package com.github.leodutra.util.tag.JNDIURLAccessTag;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
@leodutra
leodutra / highlight-and-filter.css
Last active April 26, 2016 03:27
Filter elements and Highlight text ( find , search , string )
.js-filtered-highlight {
color: yellow;
}
@leodutra
leodutra / .xsessionrc
Created June 18, 2015 19:39
Lenovo Thinkpad E430 Ubuntu 14.04 keyboard layout slash fix pt-br
#!/bin/bash
# add this file to your /home
setxkbmap -model thinkpad60 -layout br