Skip to content

Instantly share code, notes, and snippets.

View NightMachinery's full-sized avatar

Feraidoon Mehri NightMachinery

  • LMU Munich
View GitHub Profile
@lancethomps
lancethomps / close_notifications_applescript.js
Last active September 8, 2026 03:54
AppleScript to close all notifications on macOS Big Sur, Monterey, Ventura, Sonoma, and Sequoia
function run(input, parameters) {
const appNames = [];
const skipAppNames = [];
const verbose = true;
const scriptName = 'close_notifications_applescript';
const CLEAR_ALL_ACTION = 'Clear All';
const CLEAR_ALL_ACTION_TOP = 'Clear';
const CLOSE_ACTION = 'Close';
@kubinka0505
kubinka0505 / outdated.py
Last active February 26, 2024 20:32
[does not work, don't use] Simple script providing multiline text draw with emoji support (Pillow & emojicdn)
"""Simple script providing multiline text draw with emoji support (Pillow & emojicdn)"""
import io
from requests import get
from textwrap import wrap
from urllib.parse import quote_plus
from emoji import emojize, demojize, UNICODE_EMOJI
from PIL import Image, ImageDraw, ImageFont, UnidentifiedImageError
#-----#
@j-adamczyk
j-adamczyk / kmeans_with_faiss.py
Last active May 31, 2022 01:03
K-Means clustring with faiss library
import faiss
import numpy as np
class FaissKMeans:
def __init__(self, n_clusters=8, n_init=10, max_iter=300):
self.n_clusters = n_clusters
self.n_init = n_init
self.max_iter = max_iter
self.kmeans = None
@mzeryck
mzeryck / mz_invisible_widget.js
Last active August 5, 2026 02:49
A Scriptable script that creates "invisible" widget backgrounds based on your iOS wallpaper, and then either uses them as a Scriptable widget background or exports to your camera roll.
/*
MIT License
Copyright (c) 2024 Maxwell Zeryck
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 OF OR IN CONNECTION WITH THE SOFTW
@rsalzer
rsalzer / Paintings.js
Last active January 9, 2023 10:06
Scriptable to show a random painting from the Metropolitan Museum of Art
//Fetches Random Images from the metmuseum-api ; Stores the ids in the keychain in order to prevent multiple calls
//Department ID = 11 is paintings ; use other if you wish
var keychainkey = "paintingIDs"
var res
if(!Keychain.contains(keychainkey)) {
console.log("Keychainentry does not exist... create it");
const url = 'https://collectionapi.metmuseum.org/public/collection/v1/search?hasImages=true&medium=Paintings&departmentId=11&q=Painting'
const req = new Request(url)
res = await req.loadJSON()
let stringified = JSON.stringify(res)
@glowinthedark
glowinthedark / generate_directory_index_caddystyle.py
Last active July 6, 2026 20:09
Generate directory index (recurse subfolders with `-r` or `--recursive`). Use `-h` or `--help` for all options ❗️superseded by https://github.com/glowinthedark/index-html-generator
#!/usr/bin/env python3
# NOTE: this script is deprecated;
# maintained version with SVG icons: https://github.com/glowinthedark/index-html-generator/
# ---
# Copyright 2020 glowinthedark
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@radames
radames / README.md
Last active March 4, 2024 06:44
How to connect to your Google Colab Notebook via SSH!

Connect to your Google Colab Notebook via SSH

Using this amazing project tmate.io you can SSH tunnel to your colab notebook machine. You can with few lines of code download the binary, run an instance in the background and output the generated SSH address.

!wget -nc https://github.com/tmate-io/tmate/releases/download/2.4.0/tmate-2.4.0-static-linux-i386.tar.xz &> /dev/null
!tar --skip-old-files -xvf tmate-2.4.0-static-linux-i386.tar.xz &> /dev/null
!rm -f nohup.out; bash -ic 'nohup ./tmate-2.4.0-static-linux-i386/tmate -S /tmp/tmate.sock new-session -d & disown -a' >/dev/null 2>&1
!./tmate-2.4.0-static-linux-i386/tmate -S /tmp/tmate.sock wait tmate-ready
@xenodium
xenodium / ob-swiftui.el
Last active September 16, 2021 13:58
Preview SwiftUI layouts using Emacs org blocks
(use-package org
:hook ((org-mode . org-display-inline-images))
:config
(use-package ob
:bind (:map org-mode-map
("C-c C-c" . org-ctrl-c-ctrl-c))
:config
(use-package ob-swift
@gdkrmr
gdkrmr / How to reproduce the issue.txt
Last active May 19, 2020 12:31
Reproduce non-working flycheck
Ok, here is how I can reproduce it from scratch, sorry that this is so complicated:
0) Download Julia 1.4 (https://julialang.org/downloads/) and put the executable in your path. I am using the generic linux binaries and symlink `/julia-1.4/bin/julia` to `~/bin/julia`
1) Clone some Julia project, e.g.
```
git clone https://github.com/gdkrmr/Base58.jl.git
```
2) clone `lsp-julia` recursively from `https://github.com/gdkrmr/lsp-julia.git`
```
@Didacvs
Didacvs / README.MD
Created May 5, 2020 01:37 — forked from nzec/README.MD
DeezLoader Offical Page

Thanks to /u/zpoo32 for reporting several issues in this list!

Deezloader Remix

(Recommended)

Available for macOS, Linux, Windows.