Skip to content

Instantly share code, notes, and snippets.

View nicokosi's full-sized avatar
🌴
On vacation

Nicolas Kosinski nicokosi

🌴
On vacation
View GitHub Profile

Building Docker images from Dockerfiles using conventional package management systems can lead to unpredictable results due to several factors:

  1. Version inconsistencies: Package managers often default to installing the latest versions of packages. If the Dockerfile doesn't specify exact versions, different builds at different times may pull in newer package versions, potentially introducing incompatibilities or unexpected behavior.

  2. Repository changes: Package repositories can change over time. Packages may be updated, removed, or have their dependencies modified. This can lead to build failures or different package versions being installed in subsequent builds.

  3. Caching issues: Docker uses a layer caching system to speed up builds. If a package is updated in the repository but the Docker cache still holds the old version, it may not pull the latest version unless forced to do so.

  4. Network-dependent results: The build process relies on network access to download packages. Network issues or tempor

@joshcho
joshcho / reactive_render.cljc
Last active January 5, 2024 06:02
Delight, Generating Interactive Controls over Electric Code
;; This is free and unencumbered software released into the public domain.
;;
;; Anyone is free to copy, modify, publish, use, compile, sell, or
;; distribute this software, either in source code form or as a compiled
;; binary, for any purpose, commercial or non-commercial, and by any
;; means.
;;
;; In jurisdictions that recognize copyright laws, the author or authors
;; of this software dedicate any and all copyright interest in the
;; software to the public domain. We make this dedication for the benefit
/*
* This code snippet is an extract of a private codebase. Though it relies on many dependencies to
* the rest of the codebase, I believe that the code carries enough intension so that one can get
* the overall idea (see: https://blog.mathieueveillard.com/monkey-testing-et-property-based-testing-une-exploration)
*/
import fc from "fast-check";
const ALL_REDUCERS: HasName<Reducer<ApplicationState>>[] = [
withName("selectPhotograph")(pickRandomIndex(getNumberOfPhotographs)(selectionReducers.selectPhotograph)),
@adrienjoly
adrienjoly / run-npx-with-specific-nodejs-version-thru-nvm.sh
Last active June 19, 2023 08:02
Run a node.js CLI from a github repository, using a specific version of Node.js installed locally with NVM. Addresses `nvm: command not found` error, when `nvm` is invoked from a bash script.
#!/usr/bin/env bash
# Run index.js (or the script specified in package.json's "bin" entry)
# from https://github.com/adrienjoly/notion-backup,
# with the version of 18 of Node.js, installed locally with NVM.
NODE_VERSION=18 ~/.nvm/nvm-exec npx --yes github:adrienjoly/notion-backup
# Why you may need this?
# - If, like me, you have not setup a default version of node.js, on NVM.
# - If you don't want to (or can't) include a `.nvmrc` file.
@jeeger
jeeger / bookstats.clj
Last active November 26, 2022 15:37
Sum up page counts of books from Calibre library with babashka
#!/usr/bin/env bb
(ns bookstats
(:require [babashka.pods :as pods]
[clojure.pprint :as pprint]))
(pods/load-pod 'org.babashka/go-sqlite3 "0.1.0")
(pods/load-pod 'retrogradeorbit/bootleg "0.1.9")
(require '[pod.babashka.go-sqlite3 :as sqlite]
'[pod.retrogradeorbit.hickory.select :as s]
'[pod.retrogradeorbit.bootleg.utils :as utils])
(import [java.net URLEncoder]
@tastapod
tastapod / .github-workflows-release-website.yml
Last active December 20, 2021 15:53
GitHub Action to build and push Hugo website to a separate GitHub Pages repo
name: Release website
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
@ifyoumakeit
ifyoumakeit / github-conventional-comments.js
Last active August 22, 2024 19:52
GitHub Conventional Comments (instructions to install in comment below code)
(async function generateReplies(document) {
// https://conventionalcomments.org/#labels
const LABEL = {
praise: "praise",
nitpick: "nitpick",
suggestion: "suggestion",
issue: "issue",
todo: "todo",
question: "question",
thought: "thought",
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.

Poker hand ranking

Write a function that tells you the best scoring for a given poker hand of 5 cards. For instance:

(score [[3 :diamonds] [3 :hearts] [3 :spades] [5 :hearts] [:king :clubs]])
=> :three-of-a-kind ;; three 3s

Cards are represented as a tuple of rank (number or name if it's a face card) and suit. Face card names are the keywords :ace, :king, :queen, :jack. Suits are :diamonds, :spades, :hearts, :clubs.

@yogthos
yogthos / clojure-beginner.md
Last active September 10, 2024 21:41
Clojure beginner resources

Introductory resources