Skip to content

Instantly share code, notes, and snippets.

View norwd's full-sized avatar

Y. Meyer-Norwood norwd

View GitHub Profile
@norwd
norwd / keep-repo-private.yml
Created December 24, 2022 23:23
Use GitHub Actions to keep a repo private even if made public manually.
---
on: public
jobs:
make-private:
runs-on: ubuntu-latest
steps:
- run: gh repo edit ${{ github.repository }} --visibility private
env:
GH_TOKEN: ${{ secrets.KEEP_REPO_PRIVATE }}
@magnusbakken
magnusbakken / CustomXmlCommentsSchemaFilter.cs
Created January 31, 2022 10:38
A custom Swashbuckle schema filter that adds remarks to schema descriptions.
using System.Xml.XPath;
using Microsoft.OpenApi.Models;
namespace Swashbuckle.AspNetCore.SwaggerGen;
// This is a slightly modified version of the built-in XmlCommentsSchemaFilter.
// Currently our only modifications are that we append the contents of the <remarks> section to the description for each schema item.
public class CustomXmlCommentsSchemaFilter : ISchemaFilter
{
@mattiasghodsian
mattiasghodsian / readme.md
Created November 6, 2019 16:22
How to install and use youtube-dl

Ever needed a tutorial or just download non copyrighted material from YouTube to watch or listen offline?

YouTube-dl is a command-line tool which is open source and can be used to download videos from YouTube, Facebook, and other popular sites, see the full list here.


NOTE: Keep in mind some media contains copyrighted material.


@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:

@vpadhariya
vpadhariya / clone site using wget.txt
Created January 23, 2018 07:57
Clone site and remove query string values from the files in linux.
# Clone entire site.
wget --content-disposition --execute robots=off --recursive --no-parent --continue --no-clobber http://example.com
# Remove query string from a static resource.
for i in `find $1 -type f -name "*\?*"`; do mv $i `echo $i | cut -d? -f1`; done
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active June 29, 2024 23:24
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.94 Chrome/37.0.2062.94 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9
Mozilla/5.0 (iPad; CPU OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H321 Safari/600.1.4
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0)
@nextrevision
nextrevision / deleteJenkinsJobs.groovy
Created December 3, 2015 17:30
Groovy script to delete all jenkins jobs that match a regex pattern
import jenkins.model.*
def matchedJobs = Jenkins.instance.items.findAll { job ->
job.name =~ /my_regex_here/
}
matchedJobs.each { job ->
println job.name
//job.delete()
}
@amake
amake / git-svn-jenkins.org
Last active January 31, 2024 03:37
git-svn-Jenkins: Automating an svn-to-git mirror with hosted CI

Automating an svn-to-git mirror with hosted CI

There are plenty of tutorials for migrating from Subversion to git via git-svn, but they all seem to be focused on a one-time migration after which further development will happen in git. Otherwise the obvious use case for git-svn is where a lone developer uses git to push and pull to a Subversion repository from his local machine.

Like me, however, you may find yourself involved in a Subversion-hosted FOSS project with conservative leadership that strongly prefers Subversion to git. This project may also have an official git mirror of the svn repo, synced for years from a core developer’s personal machine.

You may then find yourself spearheading an effort to move this mirroring infrastructure to your project’s newly licensed hosted CI service.

This article discusses two main topics:

@rain1024
rain1024 / tut.md
Last active July 2, 2024 13:57
Install pdflatex ubuntu

PdfLatex is a tool that converts Latex sources into PDF. This is specifically very important for researchers, as they use it to publish their findings. It could be installed very easily using Linux terminal, though this seems an annoying task on Windows. Installation commands are given below.

  • Install the TexLive base
sudo apt-get install texlive-latex-base
  • Also install the recommended and extra fonts to avoid running into the error [1], when trying to use pdflatex on latex files with more fonts.