Skip to content

Instantly share code, notes, and snippets.

View kennylajara's full-sized avatar

Kenny Lajara kennylajara

View GitHub Profile
# My simple Speech Recognition Demonstration Routine 😊
# Made with ❤️ in Python 3 by Alvison Hunter - March 1st, 2020
# JavaScript, Python and Web Development tips at: https://bit.ly/3p9hpqj
# -----------------------------------------------------------------------
# Importing the libraries that will do the magic part 🐵
import speech_recognition as sr
import webbrowser as wb
def fn_speech_recognition():
sr.Microphone(device_index = 0)
print(f"MICs Found on this Computer: \n {sr.Microphone.list_microphone_names()}")
@kennylajara
kennylajara / git-auto-sign-commits.sh
Created June 29, 2021 15:43 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@kennylajara
kennylajara / index.html
Created June 16, 2021 18:13 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<html>
<head>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
@kennylajara
kennylajara / README.md
Last active June 13, 2021 01:16
Prevent delete file by accident with rm

Prevent delete file by accident with rm

When you use rm in the Linux console, you can delete a file without any confirmation message validating that this is really what you wanted to do.

To fix this, many programmers use the alias alias rm="rm -i" to ensure that a confirmation message always pops up. The problem with this workaround is that you get used to using rm without any flags and end up using it the same way when working on another console where the same alias does not exist. And, let's be honest, you don't even notice that no confirmation message popped up... if you make a mistake, bye-bye file.

The best solution for this is to get in the habit of always using a flag: normally rm -i or rm -f when you feel brave and want to delete without a confirmation message. That is what this Gist is for. It's like the little wheels on children's bicycles so they don't fall off, once they know how to ride, they can ride without it.

If you paste the code of this Gist in /bin/rmflag.sh and create t