Skip to content

Instantly share code, notes, and snippets.

View dleidert's full-sized avatar
🏠
Working from home

Daniel Leidert dleidert

🏠
Working from home
View GitHub Profile
@dleidert
dleidert / Get the download link for an asset of the latest release using site.github namespace in a Jekyll site hosted on GitHub page.md
Last active June 21, 2021 23:37
Determine latest release asset download URL from site.github in GitHub user pages
@dleidert
dleidert / template.md
Last active February 26, 2019 18:55
Automatically create changelog / news page for last 5 releases using Jekyll and GitHub Pages
{%- assign releases = site.github.releases | where: "draft", false | sort: "tag_name" | reverse -%}

## [UNRELEASED]({{ site.github.repository_url }}/tree/master/)

[compare changes to last release]({{ site.github.repository_url }}/compare/{{ releases[0].tag_name }}...master#files_bucket "Compare changes in master for upcoming release")

{% for release in releases limit:5 %}

## [{{ release.name }}]({{ release.html_url }}) {% if release.prerelease -%}(pre-release){%- endif %}
@dleidert
dleidert / Print site.github metadata.md
Last active March 1, 2019 10:13
Debug site.github metadata
---
layout: default
title: Debug site.github
---

```JSON
{{ site.github | neat_json }}
```
@dleidert
dleidert / Set notepad++ as default edit program for .html files.md
Last active February 25, 2019 12:36
Set notepad++ as default edit program for .html files
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\.html\shell\edit\command /f /ve /t REG_EXPAND_SZ /d "\"^%ProgramFiles^%\Notepad++\notepad++.exe\" %1"

This will create a new key and add an Edit option to the file context menu!

@dleidert
dleidert / Set notepad++ as default edit program for text files.md
Created February 25, 2019 12:35
Set notepad++ as default edit program for text files
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\text\shell\edit\command /f /ve /t REG_EXPAND_SZ /d "\"^%ProgramFiles^%\Notepad++\notepad++.exe\" %1"
@dleidert
dleidert / Set notepad++ as default edit program for text files.md
Created February 25, 2019 12:35
Set notepad++ as default edit program for text files
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\text\shell\edit\command /f /ve /t REG_EXPAND_SZ /d "\"^%ProgramFiles^%\Notepad++\notepad++.exe\" %1"

This will overwrite the default value!

@dleidert
dleidert / skip_commits.md
Created February 26, 2019 18:32
Skip AppVeyour build jobs for commits regarding the docs folder and subfolders

This will prevent AppVeyor from running a job, when commits are done regarding the docs directory only. It might be useful, when the projects repository contains the GitHub pages in the master branch and changes to them are not critical to the build.

skip_commits:
  files:
    - docs/**/*

I further exclude some other files too. This is my minimal list

@dleidert
dleidert / gitattributes.md
Created February 26, 2019 18:50
Exclude source files (e.g. GitHub pages) from the automatic github Zipball / Tarball creation

I usually host a projects GitHub pages (docs/) and build service configration files (e.g. .travis.yml or .appveyor.yml) together with the projects source in the master branch. When creating a release, github creates a zip and a tar archive (the so called zipball and tarball), which can also be created these links:

https://api.github.com/repos/:user/:project/tarball
https://api.github.com/repos/:user/:project/zipball

or for a specific release:

@dleidert
dleidert / prepare-commit-hook.md
Last active March 1, 2019 09:29
Skip TRAVIS-CI builds for non-build relevant file changes

TRAVIS builds are triggered by every commit to the repository. When hosting github pages with the source (e.g. in the docs folder), changes to the documentation are (usually) not critical to the build itself, so they could be easily skipped. Unfortunately TRAVIS does not offer a file-/foldername-based skip instruction like e.g. AppVeyor's skip_commits field.

But there seem to be two ways of achieving (almost) the same effect. In the following examples changes to the files

.appveyor.yml
.gitattributes
.gitignore
docs/**
@dleidert
dleidert / JSON-LD SoftwareApplication.md
Last active March 1, 2019 11:11
Provide structured (website) data for a software application using JSON-LD and GitHub pages / Jekyll

Below is an example for a jekyll template to provide structed data in JSON-LD for a software application using the site.github namespace (provided by the github-metadata) plugin). Assuming there is at least one release, this snippet is a starting point. Content represented by three dots ... usually needs to be added manually to the snippet:

{%- assign release = site.github.latest_release -%}
{
  "@context": "http://schema.org/",
  "@type": "SoftwareApplication",
  "codeRepository": "{{ repository_url }}",
  "programmingLanguage": {
    "@type": "ComputerLanguage",