Skip to content

Instantly share code, notes, and snippets.

View Asim-Tahir's full-sized avatar
:shipit:

Asım Tahir Asim-Tahir

:shipit:
  • Turkey
  • 13:59 (UTC +03:00)
View GitHub Profile
@vigo
vigo / django-bash-completion.bash
Created November 30, 2022 12:56
django bash completion
# #########################################################################
# This bash script adds tab-completion feature to django-admin.py and
# manage.py.
#
# Testing it out without installing
# =================================
#
# To test out the completion without "installing" this, just run this file
# directly, like so:
#
@claviska
claviska / form-submit-controller.ts
Last active February 15, 2022 16:52
A Reactive Controller for Custom Element Form Controls
//
// This is a Reactive Controller (https://lit.dev/docs/composition/controllers/) that allows custom elements to submit
// with standard <form> elements.
//
// The formdata event didn't land in Safari until 15.1, which is still somewhat recent. You can use this lightweight
// polyfill to make it work: https://gist.github.com/WickyNilliams/eb6a44075356ee504dd9491c5a3ab0be
//
// If your custom element shares the same API as HTMLInputElement for name/value/disabled/reportValidity, this is all
// you need to do:
//
@WickyNilliams
WickyNilliams / LICENSE
Last active May 10, 2022 15:22
formdata event polyfill
The MIT License (MIT)
Copyright (c) 2021 Nick Williams (https://wicky.nillia.ms)
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
import { unrefElement, useEventListener } from '@vueuse/core'
const defaultWindow = typeof window !== 'undefined' ? window : undefined
/**
* Listen for clicks outside of an element.
*
* @see https://vueuse.org/onClickOutside
* @param target
* @param handler
@Akryum
Akryum / hookable.spec.ts
Created August 22, 2021 13:49
Type-safe hooks
import { Hookable } from '../src/hookable'
describe('hookable', () => {
test('hook with one callback', async () => {
const hooks = new Hookable<{
invert:(value: boolean) => boolean | Promise<boolean>
}>()
hooks.hook('invert', value => !value)
@Asim-Tahir
Asim-Tahir / nginx.conf
Created May 5, 2021 15:24
Single Page Application NGINX config
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
@sindresorhus
sindresorhus / esm-package.md
Last active April 26, 2025 12:29
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@dillonchanis
dillonchanis / example.css
Created September 20, 2020 14:44
Tailwind Utility for using gradients with text
@layer utilities {
.text-gradient {
background-clip: text;
-webkit-text-fill-color: transparent;
}
}
@opus-x
opus-x / Spotify_Eliminate_Advertisements
Last active April 8, 2025 18:44
Eliminate Spotify Advertisements + Complete Server List
##################################################################################
# ELIMINATE SPOTIFY ADS (VERSION 1.2 - 8.5) - ABANDONED FOR NOW #
##################################################################################
#
# NOTE: SOMETIMES ONLY ANNOUNCEMENT OF AN AD WHILE USING APP VERSION 7.5-7.9?-8.x.
# USING AN OFFICIAL OLDER VERSION SOLVES THIS. TEST IT (APKMIRROR). THIS WILL NOT
# OCCUR USING CHROMECAST / GOOGLE HOME.
#
# COULD NOT SOLVE THE AUDIO AD INRO/OUTRO IN THE APP.
# SUGGESTIONS? WRITE A COMMENT BELOW.
@RabaDabaDoba
RabaDabaDoba / ANSI-color-codes.h
Last active April 24, 2025 04:57 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"