The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for the ‘DVCS – Distributed Version Control’ Category

Publishing a Github Gist to JSFiddle | Toolbox Tech

Posted by jpluimers on 2023/10/05

I like JSFiddle, but rather keep source code under my own version control.

I was curious, so queried [Wayback/Archive] gist as jssfiddle – Google Search and found [Wayback/Archive] Publishing a Github Gist to JSFiddle | Toolbox Tech

It has better steps than the official documentation at these links:

  • [Wayback/Archive] Pass response directly from a Github repo – JSFiddle Docs
  • [Wayback/Archive] Display fiddle from a Github repository – JSFiddle Docs

    Demo Directory/

    demo.js
    demo.html
    demo.css
    demo.details
    • demo.[ js | html | css ] contains fiddle code for the specific panel
    • demo.details is a description of the demo written in YAML
    ---
    name: Name of the Demo
    description: Some description, please keep it in one line
    authors:
    - John Doe
    - Jan Wisniewski
    resources:
    - http://some.url.com/some/file.js
    - http://other.url.com/other_filename.css
    normalize_css: no
    load_type: d
    ...
  • [Wayback/Archive] Display fiddle from Gist – JSFiddle Docs

    Read a demo from Github Gist and present it as a fiddle.

    Gist files structure

    fiddle.js
    fiddle.html
    fiddle.css
    fiddle.manifest
    File name
    Description
    fiddle.[js/html/css]
    Contains fiddle code for the specific panel
    fiddle.manifest
    YAML description of the Gist for JSFiddle to parse
    Manifest file example
    name: The Name of the Fiddle
    description: Some description, please keep it in one line
    authors:
      - John Doe
      - Jan Wisniewski
    resources:
      - http://some.url.com/some/file.js
      - http://other.url.com/other_filename.css
    normalize_css: no
    wrap: bpanel_js: 1
    panel_css: 1
    Manifest fields
    • panel_html – Language for HTML panel. Accepts:
      • 0 – HTML
    • panel_css – Language for CSS panel. Accepts:
      • 0 – CSS
      • 1 – SCSS
    • panel_js – Language for the JS panel. Accepts:
      • 0 – JavaScript
      • 1 – CoffeeScript
      • 2 – JavaScript 1.7
    • resources – List of external resources.
    • name – Fiddle title
    • description – Fiddle description
    • normalize_css – Normalize CSS by loading normalize.css before any CSS declarations.
      • yes – normalize
      • no – don’t normalize
    • wrap – Set the JS code wrap. Options:
      • l – On load
      • d – On DOM ready

–jeroen

Posted in Development, DVCS - Distributed Version Control, gist, GitHub, JavaScript/ECMAScript, JSFiddle, Scripting, Software Development, Source Code Management | 1 Comment »

Only 2 weeks left to enable 2FA for your GitHub account

Posted by jpluimers on 2023/08/29

If you haven’t done so already, then enable 2FA for your GitHub account now: This will be a requirement in 2 weeks time.

The 2FA/MFA possibility started about half a year ago with [Wayback/Archive] Raising the bar for software security: GitHub 2FA begins March 13 – The GitHub Blog

You can have various means of 2FA, which al start with a choice between:

After completing either of those those, you can view/download a set of backup codes, and you can add more factors to your Multi-factor authentication setup up to these:

Read the rest of this entry »

Posted in 2FA/MFA, Authentication, Development, DVCS - Distributed Version Control, git, GitHub, Power User, Security, Software Development, Source Code Management | Leave a Comment »

I missed that this has become way easier: Searching code – GitHub Docs

Posted by jpluimers on 2023/08/02

For my link archive, the table of contents of [Wayback/Archive/Archive] Searching code – GitHub Docs:

Limitations apply:

Due to the complexity of searching code, there are some restrictions on how searches are performed:

  • You must be signed into a user account on GitHub to search for code across all public repositories.
  • Code in forks is only searchable if the fork has more stars than the parent repository. Forks with fewer stars than the parent repository are not indexed for code search. To include forks with more stars than their parent in the search results, you will need to add fork:true or fork:only to your query. For more information, see “Searching in forks.”
  • Only the default branch is indexed for code search.
  • Only files smaller than 384 KB are searchable.
  • Only repositories with fewer than 500,000 files are searchable.
  • Only repositories that have had activity or have been returned in search results in the last year are searchable.
  • Except with filename searches, you must always include at least one search term when searching source code. For example, searching for language:javascript is not valid, while amazing language:javascript is.
  • At most, search results can show two fragments from the same file, but there may be more results within the file.
  • You can’t use the following wildcard characters as part of your search query: . , : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < > ( ) { } [ ] @. The search will simply ignore these symbols.

There is a truckload of languages supported, though the yaml format of the list is not really human readable: [Wayback/Archive] linguist/languages.yml at master · github/linguist

I’ll try this and see if it works better than Google Search.

Via:

–jeroen

Posted in Development, DVCS - Distributed Version Control, GitHub, Google, GoogleSearch, Power User, Software Development, Source Code Management | Leave a Comment »

Reading list: Remove sensitive data from your git repository

Posted by jpluimers on 2023/06/29

First: [Archive] Laurent Bugnion 🏡 🇨🇭 on Twitter: “@IrisClasson What I do is use a tool AND nuke the secret. For example generate new tokens, modify the connection string etc.” / Twitter.

I agree to nuke the secret before, as opposed to after: [Archive] Matt Kerr on Twitter: “@grahamcox82 @IrisClasson That’s why it’s best practice to issue a new key after removing it. There’s no need to worry about the old one being compromised if you’ve revoked it.” / Twitter.

For my reading list:

All via [Archive] Iris Classon on Twitter: “Don’t shame me for asking this… but… is rebase a safe way to fix accidentally pushing sensitive info to a remote repo? Obviously you’d change the secrets etc. to be sure, but in theory, will rebase remove everything, or is it still in your history somehow?” / Twitter.

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

git add a revision before first commit – Google Search

Posted by jpluimers on 2023/03/21

Will need this one day to gain better insight on how git works under the hood: [Wayback/Archive] git add a revision before first commit – Google Search

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

A pain in the ass: gist include image in markdown in current directory – Google Search

Posted by jpluimers on 2023/03/08

This revealed so much pain: [Wayback] gist include image in markdown in current directory – Google Search

I wished that – like in the past – it would work just like in a normal github hosted git repository: [Wayback/Archive] How do I display local image in markdown? – Stack Overflow.

The core problem is that though a gist underneath is a git repository, it is rendered in a way that is different than a github repository is rendered, and that way of rendering has changed over the years effectively making it difficult to embed a picture. When you do embed an image requires the uuid/guid of the raw image URL to be included in the markdown, unlike with a regular repository hosted on github.

That is so much pain that I decided to not host documentation in gists any more.

A bit of the pain:

This is an example gist where I tried to host an image: [Wayback/Archive] Windows 7 with PowerShell v2 fails to upgrade to PowerShell v3 through chocolatey: You must provide a value expression on the right-hand side of the '-' operator.

That gist was prelude to my post Chocolatey on Windows 7: “You must provide a value expression on the right-hand side of the ‘-‘ operator.”.

–jeroen

Posted in Development, DVCS - Distributed Version Control, gist, git, GitHub, Lightweight markup language, MarkDown, Software Development, Source Code Management | Leave a Comment »

Learning github actions by creating a repository with a dynamic README.md for your profile information

Posted by jpluimers on 2023/01/23

TL;DR:

  1. Create a GitHub repository with the same name as your profile name
  2. Add a README.md with Markdown describing your profile
  3. In the README.md, add begin/end HTML comment markers <!-- and --> for various types of dynamic content
  4. In the Actions of this repository, add Workflows for each of the set comment markers that use them to refresh that part of the content using GitHub Actions learning some continuous integration/continuousc deployment (CI/CD) on the fly.

You can spice this up with all kinds of badges to make it look pretty.

HTML Comments in Markdown?

Yes, it is indeed odd to have HTML comments in Markdown where you could just as easy use Markdown comments, but hey: I didn’t define the way this works.

A Markdown comment looks like this:

(empty line)
[comment]: # (This actually is the most platform independent comment)

For explanation on why/how this works, see the below two great StackOverflow answers in this order:

  1. [Wayback/Archive] syntax – Comments in Markdown: concise example – Stack Overflow by [Wayback/Archive] Magnus.
  2. [Wayback/Archive] syntax – Comments in Markdown: explainer – Stack Overflow by [Wayback/Archive] User Nick Volynkin – Stack Overflow

Howto

The below two videos (also embedded below the signature) show how to do this. Thanks [Archive] Jesse Hall 🦸‍♂️ #vsCodeHero (@codeSTACKr) | Twitter for creating them!

  1. [Wayback/Archive] Next Level GitHub Profile README (NEW) | How To Create An Amazing Profile ReadMe With GitHub Actions – YouTube
  2. [Wayback/Archive] UPDATE: Next Level GitHub Profile README (NEW) | GitHub Actions | Vercel | Spotify – YouTube

The description of the videos contain all sorts of links to sites and underlying repositories for:

  • icons
  • shields
  • badges
  • youtube/blog/RSS and other feed actions
  • profile examples

You can see the effects at [Wayback/Archive] codeSTACKr/codeSTACKr in the [Wayback/Archive] raw README.md sources.

Enough to get you some experimentation (:

Watch your commits

One of the drawbacks of mixing manual and automated changes to a repository, is that the automated changes can cause a lot of commits.

This is OK as long as the automated changes add value to the changed content.

In this regard, having stable RSS feeds is important, and YouTube is kind of bad at this when you look at [Wayback/Archive] History for README.md – codeSTACKr/codeSTACKr: videos changing order or popping in/out of the last 5 is kind of annoying.

–jeroen

Read the rest of this entry »

Posted in Development, DVCS - Distributed Version Control, git, GitHub, GitHub Actions, Lightweight markup language, MarkDown, Power User, Source Code Management | Leave a Comment »

Some experience of htmlpreview.github.io as a replacement for rawgit.com

Posted by jpluimers on 2022/12/01

With [Wayback/Archive] rawgit.com having sunset years ago, but still having a [Wayback/Archive] few links to it from my blog, it was time to take a closer look at the alternative [Wayback/Archive] htmlpreview.github.io.

First of all, htmlpreview needs more examples. I might submit a pull request for it later, as it is open source at [Archive/Archive] htmlpreview/htmlpreview.github.com: HTML Preview for GitHub Repositories.

Second, some actual example URLs, based on content I previously accessed through rawgit.com.

Read the rest of this entry »

Posted in Development, DVCS - Distributed Version Control, git, GitHub, HTML, Power User, rawgit, Software Development, Source Code Management, Versioning, Web Development | Leave a Comment »

Git (even recent versions) hanging after “Resolving deltas: 100%”

Posted by jpluimers on 2022/09/29

If you ever come across git hanging after completing “Resolving deltas: 100%“, then remember this can still happen with recent git versions; the below output was with git version 2.24.1.windows.2.

C:\bin>git clone https://wiert@gitlab.com/wiert.me/private/Windows/bin.git
Cloning into 'bin'...
remote: Enumerating objects: 74, done.
remote: Counting objects: 100% (74/74), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 1063 (delta 30), reused 39 (delta 15)
Receiving objects: 100% (1063/1063), 26.74 MiB | 516.00 KiB/s, done.
Resolving deltas: 100% (385/385), done.

or (after pressing Ctrl-C):

C:\bin>git clone https://wiert@gitlab.com/wiert.me/private/Windows/bin.git
Cloning into 'bin'...
remote: Enumerating objects: 74, done.
remote: Counting objects: 100% (74/74), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 1063 (delta 30), reused 39 (delta 15)
Receiving objects: 100% (1063/1063), 26.74 MiB | 516.00 KiB/s, done.
Resolving deltas: 100% (385/385), done.
fatal: index-pack failed

Retry after a while

Sometimes this is as easy as waiting until the remote system comes to its senses. In this case, waiting some 8 hours resolved it:

C:\bin>git clone https://wiert@gitlab.com/wiert.me/private/Windows/bin.git
C:\bin>git clone https://wiert@gitlab.com/wiert.me/private/Windows/bin.git
Cloning into 'bin'...
remote: Enumerating objects: 74, done.
remote: Counting objects: 100% (74/74), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 1063 (delta 30), reused 39 (delta 15)
Receiving objects: 100% (1063/1063), 26.74 MiB | 748.00 KiB/s, done.
Resolving deltas: 100% (385/385), done.

In my case this worked, even though GitLab did not show any problems in their status history: [WayBack] GitLab System Status History.

I waited (and succeeded) because of [WayBack] git – How to solve’fatal: index-pack failed’? – Stack Overflow.

Check the index and get the most recent

Some links that I want to check out later:

Searches

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

Don’t fall for the golden hammer: avoid git empty commits, especially for kicking off parts of your CI/CD

Posted by jpluimers on 2022/08/16

A while back Kristian Köhntopp (isotopp) wrote a blog post after quite a Twitter argument where he poses against using git empty commits. I’m with Kris: don’t use them for anything, especially not for kicking off your CI/CD.

Basically his blog post is all about avoiding to think you have a golden hammer, and avoid falling for the Law of the instrument – Wikipedia.

Originally, Abraham Maslow said in 1966:

“I suppose it is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail.”

For me this has all to do with preventing technical debt: find the right tool to kick your CI/CD pipeline after part of that chain somehow malfunctioned is way better than polluting the commit history with empty commits.

His blog post: [Wayback/Archive.is] Empty commits and other wrong tools for the job | Die wunderbare Welt von Isotopp

The most important bit in it:

And since we are talking about CI/CD pipelines: Don’t YAML them. Don’t JSON them. Don’t XML them.

Programming in any of these three is wrong use of tooling, and you should not do it.

  • YAML, JSON and XML are for declarative things.
  • Python, Go and Rust are for procedural things.
  • Bash is for interactive use only.

Use the proper tooling for the job. Be an engineer.

This very much reminds me of an Entwickler Konferenz keynote a long time ago, where Neal Ford made the point that most software engineers act very much unlike what is expected from traditional engineering way of operating where the engineer is both responsible and liable for his actions.

The start of the Twitter thread: [Archive.is] Kristian Köhntopp on Twitter: “A lot of people right now that git is an API and triggering CI/CD pipelines with empty commits replaces the equivalent of a Kubernetes controller for their fragile pile of bash in git triggers. This is broken and begets more brokenness. Evidence:… “

The tweet that started the subtweet: [Archive.is] Florian Haas on Twitter: “(For anyone wondering, what’s nice about this one is it works in any CI. So you don’t have to remember how to manually kick off a GitLab CI pipeline or GitHub Action or Zuul job, you just push an empty commit and off you go.)”

Other relevant tweets:

Yes, you want to avoid shell too (anything like for instance sh, ash, dash, bash or zsh), but you have to know it (and understand why to avoid it) as often it is the only interactive way to access systems from the console.

And of course Kris also wrote a big document on that too, which is available as full PDF (Wayback), full HTML (Wayback) and chaptered HTML Die UNIX Shell /bin/sh.

But more importantly, Kris wrote [Wayback/Archive.is] Using Python to bash | Die wunderbare Welt von Isotopp which is about using Python to do things you might be tempted to do in the shell. It quotes

Shell is a thing you want to understand and then not use, because you learned to understand it.

which is from the German post in thread [Wayback/Archive.is] Bashprogrammierung, wo gehts am besten los which quotes Kris’ 1998 message:

From kris Tue Sep 1 11:26:12 1998
From: kris
Newsgroups: de.comp.os.unix.misc
Subject: Re: Shell-Frage, find, xargs, kopieren von vielen Dateien
References: <6seh24$q9a$2...@nz12.rz.uni-karlsruhe.de>
From: kr...@koehntopp.de (Kristian Koehntopp)
Alignment: chaotic/neutral
X-Copyright: (C) Copyright 1987-1998 Kristian Koehntopp -- All rights
reserved.
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Marc.Hab...@gmx.de (Marc Haber) writes:
>mir ist das ganze Zeug mit der Shell, find, xargs und Konsorten noch
>reichlich verschlüsselt.

http://www.koehntopp.de/kris/artikel/unix/shellprogrammierung/

>xargs hin oder sollte ich besser ein Perlskript schreiben?

Verwende Perl. Shell will man koennen, dann aber nicht verwenden.

Kristian

–jeroen

Posted in *nix, *nix-tools, ash/dash, ash/dash development, bash, bash, Conference Topics, Conferences, Continuous Integration, Development, DVCS - Distributed Version Control, Event, git, Power User, Scripting, sh, Sh Shell, Software Development, Source Code Management, Technical Debt | Leave a Comment »