Skip to content

Instantly share code, notes, and snippets.

@c22dev
c22dev / DEPSteps.md
Last active May 13, 2024 15:14
Remove MDM & DEP from an Apple Sillicon Mac (Sonoma)

How to make an MDM Mac shine like it's brand new ?

Works, as of 14/04/2024, on macOS 14.4.1 and lower (prob higher but idk)

This was made for Apple Sillicon Macs.

Restore Process

You need another Mac for this.

If you don't have one and have recovery locked, it's not possible.

@CarsonSlovoka
CarsonSlovoka / README.create-toc.md
Last active May 13, 2024 15:14
Create the TOC (table of content) by javascript.
@CHIZI-0618
CHIZI-0618 / PuerNya_sing-box_fakeip_client_config.jsonc
Last active May 13, 2024 15:13
sing-box 带有 Proxy Providers 的客户端配置示例
{
"log": {
"level": "info",
"output": "sing-box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "cloudflare",
@Merott
Merott / tailwind-colors-as-css-variables.md
Last active May 13, 2024 15:11
Expose Tailwind colors as CSS custom properties (variables)

This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root element.

There are a couple of main reasons this is helpful:

  • You can reference all of Tailwind's colors—including any custom ones you define—from handwritten CSS code.
  • You can define all of your colors within the Tailwind configuration, and access the final values programmatically, which isn't possible if you did it the other way around: referencing custom CSS variables (defined in CSS code) from your Tailwind config.

See the Tailwind Plugins for more info on plugins.

@sebj
sebj / Guide.md
Last active May 13, 2024 15:10
Add a scene delegate back to a SwiftUI Project

Define an application delegate

See also: UIApplicationDelegate documentation

// AppDelegate.swift
@UIApplicationMain
final class AppDelegate: NSObject, UIApplicationDelegate {

    func application(
        _ application: UIApplication,

Header will need to be set to sticky and overlay by default.

Simply add this script to your global JS or enque as a seperate script file.

@erdesigns-eu
erdesigns-eu / vue.ts
Last active May 13, 2024 15:04
Find child components in a Vue3 component. (Alternative for Vue2 $children)
/**
* Find all Vue components that match the given matcher and return them in an array.
* @param parent The parent component to search.
* @param matcher The matcher to use.
* @returns An array of components that match the given matcher.
*/
export const findVueChildComponents = (parent: any, matcher: RegExp | String | undefined) => {
const found: any[] = [];
const root = parent.$.subTree;
@PokerGuy
PokerGuy / gist:5cdfc4ef146ce6b535bfd8e13469a2ab
Last active May 13, 2024 15:03
Push a file to SharePoint
const push = async (file, fileName) => {
const client = new aws.SecretsManager();
const spURL = `https://<your site>.sharepoint.com/sites/<your specific subsite>/_api/web/GetFolderByServerRelativeUrl('Documents')/Files/Add(url='${fileName}', overwrite=true)`;
try {
const data = await client.getSecretValue({ SecretId: '<whatever you called your secret>' }).promise();
const secret = JSON.parse(data.SecretString).<whatever you called your secret>;
const getToken = await axios.post('https://accounts.accesscontrol.windows.net/<sharepoint resource id>/tokens/OAuth/2',
querystring.stringify({
grant_type: 'client_credentials',
client_id: '<ask your sharepoint person for this it's a something@tenant id>',