Skip to content

Instantly share code, notes, and snippets.

View jrovegno's full-sized avatar

jrovegno jrovegno

View GitHub Profile
@jpierson
jpierson / switch-local-git-repo-to-fork.md
Last active December 26, 2022 21:48 — forked from jagregory/gist:710671
How to move to a fork after cloning

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step)

require 'webdrone'
a0 = Webdrone.create browser: :chrome, timeout: 10
def bajar_excel_spensiones(a0, y, m, d)
a0.open.url 'http://www.spensiones.cl/safpstats/stats/apps/vcuofon/vcfAFP.php?tf=A'
a0.form.set 'aaaaVCF', y
a0.form.set 'mmVCF', m
a0.form.set 'ddVCF', d
@igniteflow
igniteflow / env-context.py
Last active December 12, 2023 16:43
A Python context manager for setting/unsetting environment variables
from contextlib import contextmanager
"""
Usage:
with env_var('MY_VAR', 'foo'):
# is set here
# does not exist here
"""
@tdhopper
tdhopper / dataframe to kml
Created March 26, 2013 18:21
Pandas dataframe to KML in 4 lines
import simplekml
kml = simplekml.Kml()
df.apply(lambda X: kml.newpoint(name=X["name"], coords=[( X["longitude"],X["latitude"])]) ,axis=1)
kml.save(path = "data.kml")