Skip to content

Instantly share code, notes, and snippets.

@jet10000
jet10000 / readme.md
Created June 22, 2023 20:41 — forked from slava-vishnyakov/readme.md
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *
@jet10000
jet10000 / https-during-dev.macos.sh
Created October 3, 2022 13:52 — forked from disintegrator/https-during-dev.macos.sh
Use Caddy, mkcert and dnsmasq to expose your development server over HTTPS
brew install caddy mkcert nss dnsmasq
mkcert -install
mkcert '*.app.test' '*.cdn.test'
# rename the certs and move them under /usr/local/etc/caddy/certs
cat <<EOF > /usr/local/etc/caddy/Caddyfile
*.app.test:443, *.cdn.test:443 {
@jet10000
jet10000 / gist:1e0ced20bbc12622de8b36be2dca0aa2
Created March 22, 2022 17:36 — forked from shaiguitar/gist:627d52ebc0c03af488477b5d636a8909
Using docker compose to mount current working directory dynamically into the container
# mount volume PWD on host to /app in container.
shai@lappy ~/tmp/example-working-docker-compose-environment-vars [master *] ± % cat docker-compose.yml
version: "3"
services:
some_server:
...
volumes:
- $PWD:/app
@jet10000
jet10000 / admin.py
Created March 20, 2022 14:37 — forked from ricardodani/admin.py
django admin textarea widget char counter
# admin
from django import admin
from django.db import models
from widget import TextareaWithCounter
class MyModelAdmin(admin.ModelAdmin):
formfield_overrides = {
models.TextField: {'widget': TextareaWithCounter},
}
class Media:
@jet10000
jet10000 / ffmpeg.md
Created November 20, 2021 08:11 — forked from protrolium/ffmpeg.md
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@jet10000
jet10000 / App.svelte
Created September 12, 2021 02:28 — forked from sassman/App.svelte
Timer in svelte
<script>
let s = 0;
let m = 0;
let active = false;
let timer;
function setActive(a) {
active = a;
if(!active) {
clearInterval(timer)
@jet10000
jet10000 / main.dart
Created August 25, 2021 22:18 — forked from eduardoflorence/main.dart
Getx - Sample Form
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/login',
getPages: [
GetPage(
name: '/login',
page: () => LoginPage(),
@jet10000
jet10000 / create_function_plv8_cuid.sql
Created August 17, 2021 19:47 — forked from notakaos/create_function_plv8_cuid.sql
cuid for PostgreSQL with PL/v8
-- original code: https://github.com/ericelliott/cuid
-- Add the "plv8" extension
create extension if not exists "plv8";
-- Add the "pgcrypto" extension
create extension if not exists "pgcrypto";
\dx
-- Connect a database
@jet10000
jet10000 / chrome-without-cors.txt
Created February 13, 2021 04:45 — forked from BRELID/chrome-without-cors.txt
Run Chrome browser without CORS
Linux:
google-chrome --disable-web-security
Windows:
1) Right click on desktop, add new shortcut
2) Add the target as "[PATH_TO_CHROME]\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp
ex on Windows 10 :
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp
@jet10000
jet10000 / docker_volume_backup.sh
Created April 8, 2020 06:32 — forked from kiview/docker_volume_backup.sh
Docker-Compose volume backup
#!/bin/bash
compose_file_path=$1
project_name=$2
backup_path=$3
function backup_volume {
volume_name=$1
backup_destination=$2