Skip to content

Instantly share code, notes, and snippets.

View astrochun's full-sized avatar
😃
Hello, GitHub!

Chun Ly astrochun

😃
Hello, GitHub!
View GitHub Profile
@noelboss
noelboss / git-deployment.md
Last active August 12, 2025 18:16
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@hackerdem
hackerdem / check_link.py
Last active January 5, 2023 18:22
A simple python script to check broken links of a wesite
@michaelsteffen
michaelsteffen / clean_gpx.py
Created December 3, 2014 00:21
Simple script to clean GPX output from a Garmin cycling computer.
# Must be run with lxml installed to process larger data sets.
# By default looks for ./RawGPX.gpx as the input file and outputs to ./CleanedGPX.gpx. But of course one could change that easily...
import gpxpy
import gpxpy.gpx
import re
def get_furthest_point_above_speed(track, start_segment_no, start_point_no, speed, shortest_length=500):
"""
Starting from a given point on a track, finds the longest subsection of the track
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active November 4, 2025 12:43
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@glombard
glombard / reference-markdown-metadata-from-jinja-template.py
Last active March 28, 2025 20:52
How to use Markdown as a filter in a Jinja2 template, and then extract the Markdown Meta property directly from the template. Assuming you want to use the Meta-data value before rendering the converted Markdown content (e.g. in the html head), the trick is to render the markdown first, save it to a variable (html_content in this example) using a…
from pprint import pprint
import jinja2
import markdown
HTML_TEMPLATE = """{% macro get_html() %}
{{ content | markdown }}
{% endmacro %}
{% set html_content = get_html() %}
Title from Markdown meta-data: {{ get_title() }}
@wrunk
wrunk / jinja2_file_less.py
Last active April 14, 2025 10:17
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#