Skip to content

Instantly share code, notes, and snippets.

View daltonnyx's full-sized avatar
🦥

Quy Truong daltonnyx

🦥
  • Saigon Technology
  • Da Nang
View GitHub Profile
#!/bin/bash
ICON_BLUETOOTH=""
ICON_BATTERY_FULL=""
ICON_BATTERY_THREE_QUARTERS=""
ICON_BATTERY_HALF=""
ICON_BATTERY_QUARTER=""
ICON_BATTERY_EMPTY=""
BLUETOOTH_BATTERY_STATUS=$HOME/src/scripts/bluetooth_battery_status.sh
# PLA+ Profile
[stepper_x]
step_pin: PC2
dir_pin: PB9
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA5
position_endstop: 220
position_max: 220

Creating Neat .NET Core Command Line Apps

You can now read this on my (pretty) website! Check it out here.

Every reason to get more HackerPoints™ is a good one, so today we're going to write a neat command line app in .NET Core! The Common library has a really cool package Microsoft.Extensions.CommandlineUtils to help us parse command line arguments and structure our app, but sadly it's undocumented.

No more! In this guide, we'll explore the package and write a really neat

@daltonnyx
daltonnyx / cloudSettings
Created November 16, 2021 08:14
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-11-16T08:14:52.712Z","extensionVersion":"v3.4.3"}
@daltonnyx
daltonnyx / cloudSettings
Created November 16, 2021 08:14
Visual Studio Code Settings Sync Gist
// Empty
@daltonnyx
daltonnyx / cloudSettings
Created November 16, 2021 08:12
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-11-16T08:12:02.876Z","extensionVersion":"v3.4.3"}
@daltonnyx
daltonnyx / git.migrate
Created June 30, 2021 08:39 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@daltonnyx
daltonnyx / reset-commit-author.md
Created January 26, 2021 09:21 — forked from marschhuynh/reset-commit-author.md
reset-commit-author
git filter-branch --force --commit-filter '
          if [ "$GIT_COMMITTER_EMAIL" = "wrong@email.com" ];
          then
                  export GIT_COMMITTER_NAME="New Name";
                  export GIT_AUTHOR_NAME="New Nam";
                  export GIT_COMMITTER_EMAIL="new@example.com";
                  export GIT_AUTHOR_EMAIL="new@example.com";
          fi;
 git commit-tree "$@"
//Give level and quantity of dragon you want to merge
//Calculate number of level 1 dragon you need to reach it.
//Knowning merging 3 lower level dragons will get 1 dragon which has higher 1 level.
//Merging 5 lower level will get 2 dragons which have higher 1 level.
function numOfDragon(level, quantity) {
if(level == 0) return 0;
else if(level == 1) return 1 * quantity;
if(quantity % 2 == 0) {
return numOfDragon(level - 1, quantity / 2 * 5);
}