Skip to content

Instantly share code, notes, and snippets.

View hunterwei's full-sized avatar

Hunter Wei hunterwei

View GitHub Profile
# Example 1a adapted from https://www.reddit.com/r/gis/comments/4rhvhh/map_automation_arcpymapping_make_lyr/
#
# Reference: 1) http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/layer-class.htm
# 2) https://docs.python.org/2/library/json.html
import arcpy
import json
lyr = # Layer object, typically from arcpy.mapping.ListLayers (arcpy._mapping.Layer)
@hunterwei
hunterwei / npm-using-https-for-git.sh
Created June 28, 2019 22:38 — forked from taoyuan/npm-using-https-for-git.sh
Force git to use https:// instead of git://
git config --global url."https://github.com/".insteadOf [email protected]:
git config --global url."https://".insteadOf git://
@hunterwei
hunterwei / README.md
Created July 30, 2021 15:47 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@hunterwei
hunterwei / git-checkout-all-branches.sh
Created February 18, 2022 16:29 — forked from ElfSundae/git-checkout-all-branches.sh
Git checkout all remote branches
#!/bin/bash
remote=origin ; for brname in `git branch -r | grep $remote | grep -v /master | grep -v /HEAD | awk '{gsub(/^[^\/]+\//,"",$1); print $1}'`; do git branch --track $brname $remote/$brname || true; done 2>/dev/null
@hunterwei
hunterwei / git-pushing-multiple.rst
Created February 28, 2022 21:55 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@hunterwei
hunterwei / README.md
Created March 8, 2022 05:03 — forked from binki/README.md
Hyper-V Killer WiFi network speed fix powershell commands vEthernet External

See this SO answer.

Disable large send offload in host on vEthernet (to avoid messing with non-virtual adapters). Disable larg send offload in guest for all adapters (unable to predict adapter names and probably all of them are real).

@hunterwei
hunterwei / github_multiple-accounts.md
Created July 4, 2022 02:44 — forked from JoaquimLey/github_multiple-accounts.md
How to Work with GitHub and Multiple Accounts

Step 1 - Create a New SSH Key

We need to generate a unique SSH key for our second GitHub account.

ssh-keygen -t rsa -C "your-email-address"

Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY. In my case, I've saved the file to ~/.ssh/id_rsa_work.

Step 2 - Attach the New Key

@hunterwei
hunterwei / checksum_calculation.md
Created September 2, 2022 15:10 — forked from david-hoze/checksum_calculation.md
How to Calculate IP/TCP/UDP Checksum
@hunterwei
hunterwei / work-with-multiple-github-accounts.md
Created May 9, 2023 18:01 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@hunterwei
hunterwei / markdown-text-101.md
Created October 17, 2023 14:23 — forked from matthewzring/markdown-text-101.md
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers: