Skip to content

Instantly share code, notes, and snippets.

@jaemk
jaemk / push-to-someone-elses-pr.md
Created June 3, 2023 22:09 — forked from wtbarnes/push-to-someone-elses-pr.md
Brief instructions for how to modify and push to someone else's PR on github

How to Push to Someone Else's Pull Request

Let's say contributor has submitted a pull request to your (author) project (repo). They have made changes on their branch feature and have proposed to merge this into origin/master, where

origin -> https://github.com/author/repo.git

Now say you would like to make commits to their PR and push those changes. First, add their fork as a remote called

Keybase proof

I hereby claim:

  • I am jaemk on github.
  • I am jaemk (https://keybase.io/jaemk) on keybase.
  • I have a public key ASDRTrRsQ4wmHVtEbSuIri8iabfz13K-5BGkTjjXC-bdnwo

To claim this, I am signing this object:

@jaemk
jaemk / parse_db_connect_info.rs
Created April 25, 2017 22:15
parsing database connection strings
extern crate regex;
#[macro_use] extern crate lazy_static;
use regex::Regex;
lazy_static! {
static ref RE_PG: Regex = Regex::new(r"(?P<type>mysql|postgresql)://(?P<user>[^:]+):(?P<password>[^@]+)@(?P<host>[\w\.]+)(:(?P<port>[0-9]+))*(/(?P<db_name>[\w]+))*(\?(?P<extra_params>[\w=\w&]+))*").unwrap();
static ref RE_MY: Regex = Regex::new(r"(?P<type>mysql|postgresql)://(?P<user>[^:]+):(?P<password>[^@]+)@(?P<host>[\w\.]+)(:(?P<port>[0-9]+))*(/(?P<db_name>.*))*").unwrap();
}
@jaemk
jaemk / parse_db_connect_strings.rs
Created April 25, 2017 21:02
parsing db connection strings
extern crate regex;
#[macro_use] extern crate lazy_static;
use regex::Regex;
lazy_static! {
static ref RE_PG: Regex = Regex::new(r"(?P<type>mysql|postgresql)://(?P<user>[^:]+):(?P<password>[^@]+)@(?P<host>[\w\.]+)(:(?P<port>[0-9]+))*(/(?P<db_name>[\w]+))*(\?(?P<extra_params>[\w=\w&]+))*").unwrap();
static ref RE_MY: Regex = Regex::new(r"(?P<type>mysql|postgresql)://(?P<user>[^:]+):(?P<password>[^@]+)@(?P<host>[\w\.]+)(:(?P<port>[0-9]+))*(/(?P<db_name>.*))*").unwrap();
}