Skip to content

Instantly share code, notes, and snippets.

View ravicious's full-sized avatar

Rafał Cieślak ravicious

View GitHub Profile
@ravicious
ravicious / index.html
Created January 12, 2024 15:10
Electron #40798 repro
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<link href="./styles.css" rel="stylesheet">
<title>Hello World!</title>
</head>
<body>
@ravicious
ravicious / child.js
Created January 12, 2024 11:10
Electron #40798 repro attempt
const {setTimeout} = require('node:timers/promises')
process.on('SIGTERM', () => {
console.log('got SIGTERM')
setTimeout(100).then(() => {
console.log('Exiting')
process.exit(0)
})
})
@ravicious
ravicious / ubezpieczenie.md
Last active March 2, 2022 18:18
Ubezpieczenie dobrowolne po zawieszeniu działalności gospodarczej krok po kroku

Kilka podstawowych kwestii:

  • Cały proces zajmuje 2-3 tygodnie i prawie nic nie da się zrobić przez internet. Najlepiej zabrać się za to przynajmniej na dwa tygodnie przed terminem, od którego chcecie być ubezpieczeni. A można i nawet wcześniej, bo we wniosku składanym do NFZ wpisuje się, od kiedy chce się podlegać ubezpieczeniu.

  • Składka za ubezpieczenie dobrowolne jest niepodzielna. Czy zaczniecie być ubezpieczeni z pierwszym dniem miesiąca, czy z ostatnim, to i tak płacicie składkę za cały miesiąc.

  • Przez miesiąc czy tam 30 dni po zawieszeniu działalności wciąż jesteście ubezpieczeni z tytułu prowadzenia działalności.

  • Z tych właśnie powodów najlepiej zawiesić działalność z końcem miesiąca i podpisać umowę o ubezpieczenie z początkiem tego, od którego wygasa ubezpieczenie z tytułu prowadzenia działalności. Czyli np. zawieszam z końcem maja i od lipca ubezpieczam się dobrowolnie.

@ravicious
ravicious / index.html
Created May 20, 2021 16:47
Basic HTML template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Hello, World!</title>
<meta name="description" content="Basic HTML template">
</head>
<body>
</body>
@ravicious
ravicious / postgres-app-cli
Created August 1, 2020 12:05
Postgres.app: Change path to command line utilities based on the currently running version of the Postgres server
# Change path to Postgres.app command line utilities based on the version of Postgres that's currently running.
export PATH="/Applications/Postgres.app/Contents/Versions/$(psql -c 'show data_directory;' | perl -n -e '/Postgres\/var-(.+)$/ && print $1')/bin:$PATH"
@ravicious
ravicious / post.md
Created March 30, 2020 11:37
Fixing problem with libruby-static.a when installing older Ruby versions on macOS

For a long time I had this problem where installing a Ruby through ruby-build or ruby-install would fail with an error saying "Undefined symbols for architecture x86_64".

linking static-library libruby-static.a
ar: `u' modifier ignored since `D' is the default (see `U')
verifying static-library libruby-static.a
ld: warning: ignoring file libruby-static.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture x86_64:
  "_ruby_init", referenced from:
      _main in main.o
@ravicious
ravicious / elm-workshop.md
Last active February 4, 2020 09:41
Elm workshop

Before you start

This document assumes you have some basic knowledge of Elm. I recommend reading "Welcome to Elm", the first chapter from "Elm in Action" by Richard Feldman.

Session 1

Setup

Create a folder for the project and create package.json with the following contents.

@ravicious
ravicious / .zshrc
Created July 8, 2019 17:20
Time in ZSH prompt
RPROMPT="%{$fg[white]%}[%*]%{$reset_color%}"
# Reset the prompt before accepting the line.
# https://stackoverflow.com/a/35051172
function _reset-prompt-and-accept-line {
zle reset-prompt
zle .accept-line # Note the . meaning the built-in accept-line.
}
zle -N accept-line _reset-prompt-and-accept-line
[alias]
# Undoes last commit and leaves the files commited by it in the staging area.
undo-commit = reset --soft HEAD^
today = !git log --since=midnight --author=\"$(git config user.name)\" --color --graph --pretty=format:'%Cred%h%Creset - %s %Cgreen(%cr)%Creset' --abbrev-commit
yesterday = !git log --since="yesterday.midnight" --until=midnight --author=\"$(git config user.name)\" --color --graph --pretty=format:'%Cred%h%Creset - %s %Cgreen(%cr)%Creset' --abbrev-commit
# More succint version of `git status`.
st = status -sb
# It takes ages to type `rebase --continue`.
rc = rebase --continue
# My preffered version of `git log`.