Skip to content

Instantly share code, notes, and snippets.

/*
DISCLAIMER: Use at your own risk!
Discussion: https://github.com/directus/directus/discussions/18297#discussioncomment-5695833
Based on: https://gist.github.com/lukas-schaetzle/f93eff3d961ac595d0e1ab4be5f34536
Tested with Directus 10.11.2 and PostgreSQL
This will delete all flow execution logs, revisions and acitivites which are older
than the specified MinTimestamp and are not in the top <specified MinItems> latest
@mjbalcueva
mjbalcueva / password-input.tsx
Last active May 14, 2025 20:41
shadcn ui custom password input
'use client'
import * as React from 'react'
import { EyeIcon, EyeOffIcon } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Input, type InputProps } from '@/components/ui/input'
import { cn } from '@/lib/utils'
const PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(({ className, ...props }, ref) => {
@timaschew
timaschew / i18n-data-structure.md
Last active October 16, 2018 08:10
i18n support for panini

i18n datastructure

datastructure need to be created before invoking the panini gulp task

Creating the object from a yml file, for each language

 const i18nArray = ['de_DE', ' en_US'].map(lang => {
    const ymlFilePath = path.join(__dirname, '..', SRC_DIRECTORY, 'data/yml', lang) + '.yml'
 try {
@devbyray
devbyray / domIsReady.js
Last active November 13, 2023 17:46
Vanilla JavaScript Document Ready (Cross-Browser)
var domIsReady = (function(domIsReady) {
var isBrowserIeOrNot = function() {
return (!document.attachEvent || typeof document.attachEvent === "undefined" ? 'not-ie' : 'ie');
}
domIsReady = function(callback) {
if(callback && typeof callback === 'function'){
if(isBrowserIeOrNot() !== 'ie') {
document.addEventListener("DOMContentLoaded", function() {
return callback();
@nolanlawson
nolanlawson / promises_answer_sheet.md
Last active July 26, 2022 08:02
Promises puzzle cheat sheet
@erlendmrgist
erlendmrgist / Vanilla JS vs jQuery
Last active April 24, 2017 09:01 — forked from liamcurry/gist:2597326
Vanilla JS vs jQuery
# Moving from jQuery
## Events
```javascript
// jQuery
$(document).ready(function() {
// code
})
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/