Skip to content

Instantly share code, notes, and snippets.

@devnoname120
devnoname120 / README.md
Last active January 9, 2024 14:30
Karabiner-Elements — Microsoft Teams — Don't quit when pressing cmd-w on main window

Note: you need to add /Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_console_user_server in System SettingsPrivacy & SecurityAccessibility+

@devnoname120
devnoname120 / powerpoint-force-reapply-note-master.vba
Last active February 13, 2025 20:29
PowerPoint — Force to reapply the Notes Master (i.e. the template with the design/layout/style of all notes) to the notes on each slide — It's useful if you change the Notes Master design but Powerpoint only applies it to new slide notes you create so you're stuck with having your old notes in the old style
Sub RestoreNotesPages()
Dim oSld As Slide
Dim oShp As Shape
Dim lIdx As Long
On Error Resume Next
With ActivePresentation
For Each oSld In .Slides
With oSld.NotesPage.Shapes
@devnoname120
devnoname120 / ruby_remove_accents.rb
Last active June 29, 2024 05:12
[Ruby] Remove accents from UTF-8 string
class String
# See https://www.unicode.org/versions/Unicode15.0.0/UnicodeStandard-15.0.pdf#page=355
COMBINING_DIACRITICS = [*0x1DC0..0x1DFF, *0x0300..0x036F, *0xFE20..0xFE2F].pack('U*')
def removeaccents
self
.unicode_normalize(:nfd) # Decompose characters
.tr(COMBINING_DIACRITICS, '')
.unicode_normalize(:nfc) # Recompose characters
end

💸 Pay bills

👉 Summary of bill types (p. 7)

  • QR-rechnungs → Need a Swiss bank account to pay those
  • Orange slipsDon't exist anymore.
    • ✝ Replaced by QR-rechnungs (Feb. 2023)
  • Red slipsDon't exist anymore.
    • ✝ Replaced by QR-rechnungs (Feb. 2023)
@devnoname120
devnoname120 / DV, HDV, MiniDV video capture and processing.md
Last active November 26, 2024 08:20
Mini DV cassette video capture

My overview

On-cassette formats:

  • DV:
    • video: lossy compression
      • 720x480i @ 60 Hz (PAL)
      • 720x576i @ 50 Hz (NTSC)
      • aspect ratio: 4:3 or 16:3 (different pixel aspect ratios!)
    • audio: uncompressed
  • 16-bit linear PCM stereo @ 48 kHz (768 kbit/s per channel, 1.5 Mbit/s stereo) (almost always used)
@devnoname120
devnoname120 / Switzerland Visas.md
Last active November 26, 2024 08:21
Switzerland visa

Visa types:

  • Short-term Swiss visas – these are visas that permit stays of up to 90 days for purposes such as tourism or short-term business;
    • C permit (Schengen Visa) — 90 days.
  • Non-Immigrant visas – these are longer-term temporary visas for purposes such as studying or working on fixed-term contracts, where the holder doesn’t intend to stay in the country beyond a fixed period;
    • L permit — 1yr, non renewable. Tied to specific job/study contract.
    • B permit — 1-5yrs, renewable. Limited number issued every year. Requires to stay in the canton that the permit is linked to. [1] [2]
  • G permit — cross-border
@devnoname120
devnoname120 / fix-circular-deps.js
Last active November 26, 2024 08:21
Front — Fix circular dependencies
// Note: this replaces module.exports = ... with something like Object.assign(module.exports, AnalyticsSavedViewResource)
// This doesn't work but this was a worthwhile experiment and we can reuse this code as a base.
module.exports = function (file, api, options) {
const j = api.jscodeshift;
const root = j(file.source);
fixTopLevelAssignments(j, root);
fixTopLevelChainedAssignments(j, root);
@devnoname120
devnoname120 / Accord du participe passé d'un verbe pronominal.md
Last active March 9, 2022 16:29
French grammar — Accord du participe passé d'un verbe pronominal

ACCORD :

  1. Avec le COD placé avant le verbe : verbes pronominaux réfléchis / réciproques + « s'arroger ».
  • « Ma mère s'est blessée en coupant le pain. » (Ma mère a blessé qui ? Ma mère.)
  • « Ma sœur s'est donné la peine d'aider ces enfants. » (Ma sœur a donné quoi ? La peine (COD placé après le verbe).)
  • « Les fiancés se sont écrit pendant de longs mois » (Ils se sont écrit quoi ? Une lettre (à priori).)

👌  Ici on voit que le sujet a souvent valeur de COD (mais pas toujours sinon ça serait trop facile).

Pour info, les verbes suivants ont jamais de COD (mais ça sert à rien de retenir) : se plaire, se complaire, se déplaire, se rire, se sourire, se succéder, se ressembler, se parler, se nuire, se survivre, se suffire, se convenir.

@devnoname120
devnoname120 / My macOS setup.md
Last active April 1, 2025 12:49
My macOS setup

ℹ️ Enable iCloud end-to-end encryption:

  • Nobody knows that, but iCloud actually supports end-to-end encryption (see “Advanced Data Protection for iCloud”) but it's disabled by default. If you care about data privacy, you should turn it on.
    • System settingsApple IDiCloud → Set Advanced Data Protection to On.
    • System settingsApple IDiCloud → Disable Access iCloud Data on the Web.
  • It supports almost all the native Apple apps, with the notable exceptions of iCloud Mail, Contacts, and Calendars. See official data protection matrix for more info.

Table of Contents