Skip to content

Instantly share code, notes, and snippets.

View dnyall's full-sized avatar
:shipit:

daniyal abbaszadeh dnyall

:shipit:
  • Iran-tehran
View GitHub Profile
/* thanks to https://theme-toggle.rdsx.dev */
/* circle */
::view-transition-group(root) {
animation-timing-function: var(--expo-out);
}
::view-transition-old(root), .dark::view-transition-old(root) {
animation: none;
@dnyall
dnyall / Open-Folder-in-JupyterNotebook.sh
Last active December 19, 2024 19:28
osx "automator application" script to add "Open in jupyterNotebook" action in finder
# Steps to Create a Quick Action in Automator for Opening a Folder in Jupyter Notebook:
# 1. In Automator, create a Quick Action.
# 2. Set the workflow to receive current files or folders in any application.
# 3. Add a Run Shell Script action.
# 4. Set “Pass input” as “arguments”.
# 5. Paste the following bash script into the shell script section.
# Now, you can easily open the selected folder in Jupyter Notebook from finder actions. Enjoy!
@dnyall
dnyall / get-random-unused-port
Last active August 13, 2024 13:44
get random unused port (bash)
ruby -e 'require "socket"; puts Addrinfo.tcp("", 0).bind {|s| s.local_address.ip_port }'
# OR
comm -23 \
<(seq "$FROM" "$TO") \
<(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep '[0-9]\{1,5\}' | sort -n | uniq) \
| shuf | head -n "$HOWMANY"
@dnyall
dnyall / watch4ElementAdded||Removed.js
Last active December 19, 2024 19:34
watchForElement function - if specefic element add or remove from dom
function watchForElement(className , cb) {
const observer = new MutationObserver((mutationsList) => {
for (const mutation of mutationsList) {
if (mutation.type === 'childList') {
const addedNodes = Array.from(mutation.addedNodes);
const elementExists = addedNodes.some(node => node.classList && node.classList.contains(`${className}`));
if (elementExists) {
// Element with the specific class has been added to the DOM
console.log('Element added!');
@dnyall
dnyall / ubuntu-install-bitchx.sh
Created June 4, 2023 21:44 — forked from AubreyHewes/ubuntu-install-bitchx.sh
Compile and Install BitchX on Ubuntu
#!/bin/sh
####################################################################################
#
# Download Compile and Install BitchX on Ubuntu
#
####################################################################################
# download bitchx source
# @todo make smarter, i.e. regexp, though now uses _always_ available commands (sic)