Skip to content

Instantly share code, notes, and snippets.

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@dnanhkhoa
dnanhkhoa / README.md
Created April 5, 2024 19:07 — forked from acamino/README.md
Shortcuts to Improve Your Bash & Zsh Productivity

Shortcut — Action

  • CTRL + A — Move to the beginning of the line
  • CTRL + E — Move to the end of the line
  • CTRL + [left arrow] — Move one word backward (on some systems this is ALT + B)
  • CTRL + [right arrow] — Move one word forward (on some systems this is ALT + F)
  • CTRL + U — (bash) Clear the characters on the line before the current cursor position
  • CTRL + U —(zsh) If you're using the zsh, this will clear the entire line
  • CTRL + K — Clear the characters on the line after the current cursor position
  • ESC + [backspace] — Delete the word in front of the cursor
@dnanhkhoa
dnanhkhoa / private_fork.md
Created October 1, 2023 19:10 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

# -*- coding: utf-8 -*-
# This is an implementation of this paper modified with edit distance and partial matching algorithms:
# Simple and Efficient Algorithm for Approximate Dictionary Matching
# https://www.aclweb.org/anthology/C10-1096.pdf
# Edit Distance algorithm
# https://en.wikipedia.org/wiki/Edit_distance
import math
import random
import string
@dnanhkhoa
dnanhkhoa / approximate_code_retrieval.py
Last active November 4, 2019 04:51
N-gram + Edit Distance
# -*- coding: utf-8 -*-
# This is an implementation of the paper modified with edit distance algorithm:
# Simple and Efficient Algorithm for Approximate Dictionary Matching
# https://www.aclweb.org/anthology/C10-1096.pdf
# Edit Distance algorithm
# https://en.wikipedia.org/wiki/Edit_distance
import math
import random
import string
# -*- coding: utf-8 -*-
import random
import string
from collections import defaultdict
random.seed(42)
def generate_random_code(valid_chars, code_len):
return "".join(random.choices(valid_chars, k=code_len))