Skip to content

Instantly share code, notes, and snippets.

@bskiefer
bskiefer / README.md
Last active April 10, 2024 21:14
VSCodium Update Extensions from VS Marketplace

This script will gather the extensions currently installed for VSCodium and update them from marketplace.visualstudio.com automatically.

  • Packages defined under $SKIP are ignored.
  • Old extension folders are removed before the update is installed.

Why?

  • open-vsx.org doesn't get updated very quickly, if at all
  • it's "illegal" to use the VS Marketplace as the extension source in non-M$ products
@aslafy-z
aslafy-z / Jenkinsfile
Last active December 13, 2023 19:52 — forked from rufoa/Jenkinsfile
Jenkins [skip ci] implementation for multi-branch declarative pipeline
pipeline {
...
stages {
stage('Run CI?') {
steps {
script {
if (sh(script: "git log -1 --pretty=%B | grep -F -ie '[skip ci]' -e '[ci skip]'", returnStatus: true) == 0) {
currentBuild.result = 'NOT_BUILT'
error 'Aborting because commit message contains [skip ci]'
@umanghome
umanghome / publish.yml
Last active April 27, 2024 19:23
GitHub Action: Generate a build and push to another branch
# .github/workflows/publish.yml
name: Generate a build and push to another branch
on:
push:
branches:
- master # Remove this line if your primary branch is "main"
- main # Remove this line if your primary branch is "master"
jobs:
/* sidenotes.js: standalone JS library for parsing HTML documents with Pandoc-style footnotes and dynamically repositioning them into the left/right margins, when browser windows are wide enough.
Sidenotes are superior to footnotes where possible because they enable the reader to immediately look at them without requiring user action to 'go to' or 'pop up' the footnotes; even floating footnotes require effort by the reader.
sidenotes.js is inspired by the Tufte-CSS sidenotes (https://edwardtufte.github.io/tufte-css/#sidenotes), but where Tufte-CSS uses static footnotes inlined into the body of the page (requiring modifications to Pandoc's compilation), which doesn't always work well for particularly long or frequent sidenotes, sidenotes.js will rearrange sidenotes to fit as best as possible, and will respond to window changes.
Particularly long sidenotes are also partially 'collapsed'.
Author: Said Achmiz
2019-03-11
license: MIT (derivative of footnotes.js, which is PD)
*/
@onlurking
onlurking / programming-as-theory-building.md
Last active April 19, 2024 22:31
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@composite
composite / SpelLoggerEvaluator.java
Created February 13, 2020 09:29
Logback Appender filter with Spring EL based evaluator. If you are using Spring, no other dependency required.
package your.logging.util;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.boolex.EventEvaluatorBase;
import org.springframework.expression.EvaluationException;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.ParseException;
import org.springframework.expression.spel.standard.SpelExpressionParser;
/* sidenotes.js: standalone JS library for parsing HTML documents with Pandoc-style footnotes and dynamically repositioning them into the left/right margins, when browser windows are wide enough.
Sidenotes are superior to footnotes where possible because they enable the reader to immediately look at them without requiring user action to 'go to' or 'pop up' the footnotes; even floating footnotes require effort by the reader.
sidenotes.js is inspired by the Tufte-CSS sidenotes (https://edwardtufte.github.io/tufte-css/#sidenotes), but where Tufte-CSS uses static footnotes inlined into the body of the page (requiring modifications to Pandoc's compilation), which doesn't always work well for particularly long or frequent sidenotes, sidenotes.js will rearrange sidenotes to fit as best as possible, and will respond to window changes.
Particularly long sidenotes are also partially 'collapsed'.
Author: Said Achmiz
2019-03-11
license: MIT (derivative of footnotes.js, which is PD)
*/
@riceissa
riceissa / anki_algorithm.py
Last active December 15, 2023 09:36
my current understanding of Anki's spacing algorithm
"""
This is my understanding of the Anki scheduling algorithm, which I mostly
got from watching https://www.youtube.com/watch?v=lz60qTP2Gx0
and https://www.youtube.com/watch?v=1XaJjbCSXT0
and from reading
https://faqs.ankiweb.net/what-spaced-repetition-algorithm.html
There is also https://github.com/dae/anki/blob/master/anki/sched.py but I find
it really hard to understand.
Things I don't bother to implement here: the random fudge factor (that Anki
@munificent
munificent / generate.c
Last active May 1, 2024 20:06
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@cellularmitosis
cellularmitosis / solutions-by-exercise.md
Last active May 25, 2021 21:20
Index of Exercism.io solutions, grouped by problem

Blog 2019/1/25

<- previous | index | next ->

Index of solutions to Exercism.io problems (grouped by exercise)

Browsing solutions to the same problem is a great way to compare languages!