Skip to content

Instantly share code, notes, and snippets.

View dominikwilkowski's full-sized avatar
🤖
Working

Dominik Wilkowski dominikwilkowski

🤖
Working
View GitHub Profile
@dominikwilkowski
dominikwilkowski / Gernerate_SVG_From_QR_Code.md
Last active August 27, 2024 22:33
Generate a leaner SVG from QR-Code-generator

Generate a leaner SVG from QR-Code-generator

This is a quick function that can convert a QR code generated with the rust version of QR-Code-generator into a much smaller SVG than the to_svg_string function included in their example. The function is made generic so that you may use this function with other qr sources. All the function needs is a method to check coordinates if they contain a block box or not besides the size and border values.

So if you have the data for your QR code, all you need is to write a method as I did in the FakeQr struct for the tests.

The SVG optimizations:

  • Remove unneeded attributes, tags and whitespace
  • Use short form for hex colors

Some principles and techniques I use in my teams at the moment. I hope these could be helpful for Technical Leads or Product Owners.

Addressing challenges with estimating

Software engineers enjoy solving problems with code. They value understanding why the thing they are working on is important.

For almost all non-trivial tasks, the full scope of dependencies, technical limitations and edge cases only reveal themselves during the development process. For this reason, I try to make the initial planning light touch and focus on the problem to solve. Accepting that we will start the development process before knowing everything can make estimating difficult. Forcing engineers to commit to specific estimates makes them feel that they cannot modify their approach if they learn something through the process of doing. Here are some reasons engineers can struggle with estimating and what can be done to help.

Estimating work that has too many unknowns

@Dan-Q
Dan-Q / _no_code_page_.php
Last active October 12, 2024 16:49
Hacky PHP to produce a "blank" web page which somehow has content when viewed in Firefox. Sample page at https://danq.me/wp-content/no-code-webpage/, explanation at https://danq.me/nocode
<?php
// half-hearted CSS minification
$css = preg_replace(
array('/\s*(\w)\s*{\s*/','/\s*(\S*:)(\s*)([^;]*)(\s|\n)*;(\n|\s)*/','/\n/','/\s*}\s*/'),
array('$1{ ','$1$3;',"",'} '),
file_get_contents('linked.css')
);
// embed as a data: uri
$base64css = rtrim(strtr(base64_encode($css), '+/', '-_'), '=');
@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active May 13, 2025 14:27
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@0xabad1dea
0xabad1dea / copilot-risk-assessment.md
Last active September 11, 2023 10:21
Risk Assessment of GitHub Copilot

Risk Assessment of GitHub Copilot

0xabad1dea, July 2021

this is a rough draft and may be updated with more examples

GitHub was kind enough to grant me swift access to the Copilot test phase despite me @'ing them several hundred times about ICE. I would like to examine it not in terms of productivity, but security. How risky is it to allow an AI to write some or all of your code?

Ultimately, a human being must take responsibility for every line of code that is committed. AI should not be used for "responsibility washing." However, Copilot is a tool, and workers need their tools to be reliable. A carpenter doesn't have to

@sindresorhus
sindresorhus / esm-package.md
Last active May 14, 2025 06:52
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@LeZuse
LeZuse / 00_README.md
Last active February 11, 2025 03:08
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)

Node.js on Apple Silicon

Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.

TODO

  • find a way how to run the same node version on both platforms
@dominikwilkowski
dominikwilkowski / README.md
Last active May 11, 2025 00:14
ANSI codes for cli controled output

ANSI escape sequences

ANSI escape sequences can be printed to a shell to as instructions. The below is a list of codes I have used often in my CLI programs and I find myself looking up over and over again.

A great article about it can be found here.

Content

@surpher
surpher / rust_to_swift.md
Last active April 11, 2025 03:03
Building binaries from Rust to iOS/macOS (PactSwift specific)
@dominikwilkowski
dominikwilkowski / README.md
Last active November 19, 2021 23:26
Signed git commits with Git Tower on Catalina and Monterey