Skip to content

Instantly share code, notes, and snippets.

Avatar
🐫

Omar Ryhan omarryhan

🐫
View GitHub Profile
@0xpizza
0xpizza / async_tcp_scan.py
Last active Nov 20, 2021
TCP Network scanner using asyncio for Python 3.7
View async_tcp_scan.py
#!/usr/bin/python3.7
import asyncio
import ipaddress
import re
import sys
MAX_NUMBER_WORKERS = 200
@stpe
stpe / youtube_topicIDs.md
Last active Oct 15, 2021
YouTube Topic IDs
View youtube_topicIDs.md

Music topics

  • /m/04rlf Music
  • /m/05fw6t Children's music
  • /m/02mscn Christian music
  • /m/0ggq0m Classical music
  • /m/01lyv Country
  • /m/02lkt Electronic music
  • /m/0glt670 Hip hop music
  • /m/05rwpb Independent music
@adam-p
adam-p / Local PR test and merge.md
Last active Nov 8, 2021
Testing a pull request, then merging locally; and avoiding TOCTOU
View Local PR test and merge.md

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: https://github.com/Psiphon-Labs/psiphon-tunnel-core/pull/37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37
@piscisaureus
piscisaureus / pr.md
Created Aug 13, 2012
Checkout github pull requests locally
View pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: