Skip to content

Instantly share code, notes, and snippets.

View ludwigtuerme's full-sized avatar
🎩
Du bi du bi du ba

Luis Torres ludwigtuerme

🎩
Du bi du bi du ba
View GitHub Profile
@alejoriosm04
alejoriosm04 / binaryTree.py
Created October 27, 2022 02:25
Python script to test the behavior of a binary tree
"""
Test the behavior of a binary tree
Written in Python by Alejandro Ríos
For the course "Data Structures and Algorithms I" at EAFIT University
- Links the functions and classes of binaryTree.py with your main file
- Prints your Binary Tree in the console
- Create a Binary Tree from scratch and see the output from your modifications
@ludwigtuerme
ludwigtuerme / RecursiveSmallestInteger2DArray.java
Last active November 6, 2022 17:14
Recursively find smallest integer in 2D array (Java). Disclaimer: This program does not really make sense.
/**
* Find the smallest integer in a 2D array.
* This program does not really make sense.
*
* @author Luis M. Torres-Villegas
* @version 2022.11.05
*/
public class RecursiveSmallestInteger2DArray {
public static void main(String args[]) {
gen-username() {
vowel() {
head /dev/urandom | tr -dc 'aeiueoy' | cut -c1
}
consonant() {
head /dev/urandom | tr -dc 'qwrtpsdfghjklzxcvbnm' | cut -c1
}
digit() {
head /dev/urandom | tr -dc '[:digit:]' | cut -c1
}
@paolocarrasco
paolocarrasco / README.md
Last active May 3, 2024 15:20
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@Mark-Han
Mark-Han / SumatraPDF-settings.txt
Last active December 19, 2023 01:20
my user setting file for Sumatra, the PDF viewer on Windows
# For documentation, see http://www.sumatrapdfreader.org/settings3.2.html
MainWindowBackground = #000000
EscToExit = true
ReuseInstance = false
UseSysColors = true
RestoreSession = true
FixedPageUI [
TextColor = #000000
@jg-you
jg-you / draw_nx_beautiful.py
Last active October 30, 2022 00:04
Beautiful networkx graph
import copy
import networkx
import matplotlib.pyplot as plt
# Generate a graph.
# Here I chose an ER graph.
g = nx.erdos_renyi_graph(20, 0.3)
# Get positions.
# Here I use the spectral layout and add a little bit of noise.
@ivanistheone
ivanistheone / .cleanup.sh
Last active December 30, 2022 14:09
A shell script I use to (mostly) automatically cleanup my ~/Desktop
#!/bin/bash
MYHOME=$HOME
MYDESKTOP=$HOME/Desktop
echo " _ "
echo " | | "
echo " ___ | | ___ __ _ _ __ _ _ _ __ "
echo " / __|| |/ _ \/ _ | '_ \| | | | '_ \ "
echo " | (__ | | __/ (_| | | | | |_| | |_) |"
echo " \___||_|\___|\__,_|_| |_|\__,_| .__/ "
@simonsmith
simonsmith / hotkeys.md
Created May 16, 2014 11:05
List of Bash hotkeys for Mac

Bash Keyboard Shortcuts - Mac

Enable Option Key as Meta in iTerm. Set as Esc+ - http://stackoverflow.com/a/438892

Moving the cursor

  • Ctrl + a Go to the beginning of the line (Home)
  • Ctrl + e Go to the End of the line (End)
  • Ctrl + p Previous command (Up arrow)
  • Ctrl + n Next command (Down arrow)

How not to rm yourself

Copied from https://github.com/sindresorhus/guides/blob/master/how-not-to-rm-yourself.md

The rm command is inherently dangerous and should not be used directly. It can at worst let you accidentally remove everything. Here's how you can protect you from yourself.

Use trash

The trash command-line tool will move stuff to the trash instead of permanently deleting it. You should not alias rm to trash as it will break external scripts relaying on the behavior of rm. Instead use it directly: trash image.jpg.

@mwhite
mwhite / git-aliases.md
Last active April 30, 2024 11:32
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc