Skip to content

Instantly share code, notes, and snippets.

View omarryhan's full-sized avatar
💥

Omar Ryhan omarryhan

💥
View GitHub Profile
@0xpizza
0xpizza / async_tcp_scan.py
Last active November 20, 2021 15:25
TCP Network scanner using asyncio for Python 3.7
#!/usr/bin/python3.7
import asyncio
import ipaddress
import re
import sys
MAX_NUMBER_WORKERS = 200
@stpe
stpe / youtube_topicIDs.md
Last active April 6, 2024 22:36
YouTube Topic IDs

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 February 5, 2024 19:39
Testing a pull request, then merging locally; and avoiding TOCTOU

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: Psiphon-Labs/psiphon-tunnel-core#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 August 13, 2012 16:12
Checkout github pull requests locally

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: