Skip to content

Instantly share code, notes, and snippets.

Disable Device Enrollment Program (DEP) notification on macOS Monterey.md

NB! command-R is replaced with holding the power button on M1 macs.

With full reinstall (recommended)

   a. Boot into recovery using command-R during reboot, wipe the harddrive using Disk Utility, and select reinstall macOS

   b. Initial installation will run for approximately 1 hour, and reboot once

@kurdin
kurdin / DefaultFonts.css
Created December 4, 2022 16:37 — forked from harrydayexe/DefaultFonts.css
CSS Default System Fonts
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
/*
The MIT License (MIT)
Copyright (c) 2016 Gildas Lormeau (Capsule Code)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT O
@kurdin
kurdin / userscript.js
Created December 1, 2022 21:27 — forked from gildas-lormeau/userscript.js
Save page in reader mode with SingleFile
// ==UserScript==
// @name Save page in reader mode
// @namespace https://github.com/gildas-lormeau/SingleFile/
// @version 1.0
// @description Save page in reader mode with SingleFile
// @author Gildas Lormeau
// @match *://*/*
// @grant none
// ==/UserScript==
@kurdin
kurdin / pg-change-timezone.md
Created June 8, 2022 20:39 — forked from prestonp/pg-change-timezone.md
Change timezone in pg

Changing timezone in postgres

To change your server’s timezone per session you can use the following query:

set timezone TO 'GMT';

If you need to permanently update the timezone, find your postgresql.conf file in psql:

@kurdin
kurdin / broadcast-channel-es6.js
Created July 13, 2021 14:47 — forked from alexis89x/broadcast-channel-es6.js
Broadcast Channel API polyfill
/**
@class BroadcastChannel
A simple BroadcastChannel polyfill that works with all major browsers.
Please refer to the official MDN documentation of the Broadcast Channel API.
@see <a href="https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API">Broadcast Channel API on MDN</a>
@author Alessandro Piana
@version 0.0.6
*/
/*
@kurdin
kurdin / simple-state-machine.js
Created April 15, 2020 17:54
Simple State Machine
function createMachine(stateMachineDefinition) {
const machine = {
value: stateMachineDefinition.initialState,
transition(currentState, event) {
const currentStateDefinition = stateMachineDefinition[currentState]
const destinationTransition = currentStateDefinition.transitions[event]
if (!destinationTransition) {
return
}
const destinationState = destinationTransition.target
tryES6.com/9WS4pMfJT
function runSerial(tasks, fn) {
return tasks.reduce((promise, task) => promise.then(previous => fn(task, previous)), Promise.resolve(null))
}
function runParallel(tasks, fn) {
return Promise.all(tasks.map(task => fn(task)))
}
@kurdin
kurdin / convert1251toUTF8
Created September 14, 2019 23:38
win1251 to utf-8
find ./ -name "*.php" -o -name "*.htm" -o -name "*.html" -o -name "*.css" -o -name "*.js" -o -name "*.txt" -type f |
while read file
do
if ! file -bi $file | grep -q 'utf-8'
then
echo " $file"
mv "$file" "$file".icv
iconv -f WINDOWS-1251 -t UTF-8 "$file".icv > "$file"
rm -f "$file".icv
fi
@kurdin
kurdin / FizzBuzz.js
Created August 23, 2018 14:09 — forked from jaysonrowe/FizzBuzz.js
FizzBuzz JavaScript solution
for (var i=1; i <= 20; i++)
{
if (i % 15 == 0)
console.log("FizzBuzz");
else if (i % 3 == 0)
console.log("Fizz");
else if (i % 5 == 0)
console.log("Buzz");
else
console.log(i);