Skip to content

Instantly share code, notes, and snippets.

View basola21's full-sized avatar
:shipit:
Under refactoring….

Basel Mahmoud basola21

:shipit:
Under refactoring….
View GitHub Profile
#!/bin/bash
# pid file is because every thing in linux is a file
# mainly keeps track of the process id
PIDFILE="/tmp/wallpaper-daemon.pid"
LOGFILE="/tmp/wallpaper-daemon.log"
start() {
if [[ -f "$PIDFILE" ]] && kill -0 "$(cat "$PIDFILE")" 2>/dev/null; then
echo "Daemon is already running (PID $(cat "$PIDFILE"))"
def qsort(inlist):
if inlist == []:
return []
else:
pivot = inlist[0]
lesser = qsort([x for x in inlist[1:] if x < pivot])
greater = qsort([x for x in inlist[1:] if x >= pivot])
return lesser + [pivot] + greater
@basola21
basola21 / takeThePower.js
Created September 14, 2023 15:19
Taking the paste power back
function dontTreadOnMe(e) {
e.stopImmediatePropagation()
}
documnet.addEventListener(
"paste",
dontTreadOnMe,
true
):
@basola21
basola21 / regex.txt
Created May 9, 2023 08:21
Regex for the static files in djnago template
Find what:
(href|src)="([a-zA-Z0-9/.-]+[^.html])"
Replace with:
$1=\"{% static 'assets/$2' %}"