Skip to content

Instantly share code, notes, and snippets.

@AnoRebel
AnoRebel / dav_to_mp4.py
Last active August 22, 2024 12:49 — forked from jdye64/gist:ca07e01ff3d8e93210c3
Convert .dav files in current directory to .mp4
#!/usr/bin/python
print("Converting all of the .dav files in this current directory into .mp4 files using ffmpeg")
import os
from subprocess import call
files = [f for f in os.listdir('.') if os.path.isfile(f)]
for f in files:
ext = f.split(".")[-1]
if ext == "dav" or ext == "DAV":
@AnoRebel
AnoRebel / spiral.vue
Created January 6, 2024 10:23
Vue 3 spiral component copied from an instagram reel
<script setup>
import { ref, onMounted } from 'vue'
const ANIMATION_DURATION = 4000; // ms
const spiral = ref(null);
const spiral_1 = ref(null);
const words = ref("anorebel");
onMounted(() => {
@AnoRebel
AnoRebel / knexPostgresFullTextSearch.js
Created November 8, 2023 07:35 — forked from cameronblandford/knexPostgresFullTextSearch.js
Implement full text search using Knex + Objection
// Because we're using an ORM (Objection), it's a pain to add a tsvector when inserting,
// since tsvectors and FTS aren't supported by Objection. Instead, I've added a hook that
// fires on insert which auto-generates the tsvector field for each newly inserted entry.
// This is an example knex migration file for said behavior.
const addUserIndex = `
ALTER TABLE public.user ADD "document" tsvector;
CREATE FUNCTION my_trigger_function()
RETURNS trigger AS $$
@AnoRebel
AnoRebel / CodeGenerator.ts
Last active August 2, 2023 12:34
Bar and QR code generator in Vue 3 using `jsbarcode` and `qrcode`
/**
* Script made from https://github.com/fengyuanchen/vue-qrcode and https://github.com/fengyuanchen/vue-barcode
*/
import { defineComponent, h, watch, ref, onMounted } from "vue"
import * as JsBarcode from "jsbarcode"
import { toCanvas, toDataURL, toString } from "qrcode"
const EVENT_READY = "ready"
export default defineComponent(
@AnoRebel
AnoRebel / OTP_Input.html
Created May 22, 2023 16:23 — forked from tinshade/OTP_Input.html
Simple Bootstrap, JS code for OTP styled inputs. Feel free to make this mobile responsive.
<!DOCTYPE html>
<html>
<head>
<title>OTP Input</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<style>
*{
margin:0px;
padding:0px;
}
@AnoRebel
AnoRebel / index.ts
Last active May 14, 2023 12:02
A Vue 3 Typescript composable remade from https://github.com/sirxemic/jquery.ripples
import { type Ref, ref } from "vue";
import type {
IConfig,
ILocations,
IOptions,
IRipples,
IUniforms,
} from "./types";
import {
@AnoRebel
AnoRebel / Drawer.vue
Created March 15, 2023 15:56
Vue 3 Drawers
<template>
<section v-if="enabled">
<aside class="sidebar" :style="style" ref="element">
<slot></slot>
</aside>
<div class="overlay" ref="overlay"></div>
</section>
</template>
<script setup>
@AnoRebel
AnoRebel / neumorphic_loader.css
Created February 28, 2023 14:53
A cool neumorphic loader
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
@AnoRebel
AnoRebel / hacker_effect.html
Created January 27, 2023 13:32
Dope hacker effect from [Hyperplexed](https://www.youtube.com/W5oawMJaXbU)
<style>
div {
font-family: `Monospaced font`;
}
</style>
<div data-value="AnoRebel">AnoRebel</div>
@AnoRebel
AnoRebel / anim_submit.js
Created October 15, 2022 18:47
A collection of button effects in html, css, javascript
$(function() {
$( "#button" ).click(function() {
$( "#button" ).addClass( "onclic", 250, validate);
});
function validate() {
setTimeout(function() {
$( "#button" ).removeClass( "onclic" );
$( "#button" ).addClass( "validate", 450, callback );
}, 2250 );