Skip to content

Instantly share code, notes, and snippets.

View kkpan11's full-sized avatar

Gianni Hong kkpan11

View GitHub Profile
@kkpan11
kkpan11 / Synology-Diskstation-Git.md
Created September 4, 2025 18:43 — forked from walkerjeffd/Synology-Diskstation-Git.md
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation
@kkpan11
kkpan11 / m3u8.md
Created February 13, 2024 04:05 — forked from primaryobjects/m3u8.md
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@kkpan11
kkpan11 / geomid.R
Created February 13, 2024 02:06 — forked from dnanto/geomid.R
Calculate the geographic midpoint given a list of geographic coordinates in R.
library(tidyverse)
geomid <- function(lat, lon)
{
# http://www.geomidpoint.com/calculation.html
lat <- lat * pi / 180
lon <- lon * pi / 180
x <- mean(sum(cos(lat) * cos(lon)))
y <- mean(sum(cos(lat) * sin(lon)))
z <- mean(sum(sin(lat)))
@kkpan11
kkpan11 / gh_url_to_raw_gh_url.py
Created December 22, 2023 07:24 — forked from fedarko/gh_url_to_raw_gh_url.py
Convert a github file URL to a raw.githubusercontent.com URL (that can be directly accessed for things like view.qiime2.org or wget)
# your link goes here
link = "https://github.com/knightlab-analyses/qurro-mackerel-analysis/blob/master/AnalysisOutput/qurro-plot.qzv"
# note: this will break if a repo/organization or subfolder is named "blob" -- would be ideal to use a fancy regex
# to be more precise here
print(link.replace("github.com", "raw.githubusercontent.com").replace("/blob/", "/"))
# example output link:
# https://raw.githubusercontent.com/knightlab-analyses/qurro-mackerel-analysis/master/AnalysisOutput/qurro-plot.qzv
@kkpan11
kkpan11 / semantic-commit-messages.md
Created December 11, 2023 18:53 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@kkpan11
kkpan11 / RAML vs OAS.md
Created December 4, 2023 20:54 — forked from EliFuzz/RAML vs OAS.md
Comparison table between RAML and OAS
Features RAML OAS
popularity less popular more popular and widely used
backed by Mulesoft OpenAPI Initiative, which is a consortium of industry leaders and experts
expressiveness more expressive and flexible less due to lack of annotations, overlays, extensions, libraries
interoperability less compatable more interoperable and compatible
maintenance relatively less updates more actively maintained and updated with a clear roadmap and vision for its future
focused on modeling APIs
@kkpan11
kkpan11 / TaskConcurrencyManifesto.md
Created November 24, 2023 21:23 — forked from yxztj/TaskConcurrencyManifesto.md
Swift Concurrency Manifesto 中文翻译
@kkpan11
kkpan11 / TaskConcurrencyManifesto.md
Created November 24, 2023 21:22 — forked from lattner/TaskConcurrencyManifesto.md
Swift Concurrency Manifesto
@kkpan11
kkpan11 / 1-setup.md
Created November 18, 2023 07:52 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS

Methods of Signing with a GPG Key on MacOS

Last updated September 21, 2022

This Gist explains how to do this using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

There has been a number of comments on this gist regarding some issues around the pinentry-program and M1 Macs. I've finally gotten a chance to try things out on an M1 and I've updated the documentation in 2-using-gpg.md to reflect my findings.

@kkpan11
kkpan11 / change-openssl-version.md
Created November 17, 2023 09:09 — forked from zulhfreelancer/change-openssl-version.md
How to switch OpenSSL version on Mac using Homebrew?

How to switch OpenSSL version on Mac using Homebrew?

Scenario: you have both OpenSSL 1.0 and 1.1 installed (using Brew) in your OSX system and you want to switch the current active version without removing other versions that already installed. Here is how to do it.

Step 1 - List all OpenSSL versions

$ ls -al /usr/local/Cellar/openssl*

/usr/local/Cellar/openssl: