Skip to content

Instantly share code, notes, and snippets.

@AnoRebel
AnoRebel / WaterRipple.js
Last active March 16, 2025 18:57
Closest to my desired water ripple effect by github.com/youyouzh/WaterRipple
// WaterRipple.js
/**
* Water Ripple Effect
* Originally created by youyouzh on 2018/3/11
* Optimized and extended for better performance and background support.
* Enhancements:
* 1. Supports background images, colors, and gradients.
* 2. Controlled wave disturbances instead of random flickering.
* 3. Performance optimizations: Processes only affected pixels.
* 4. Allows triggering ripples on user interaction.
@AnoRebel
AnoRebel / index.html
Created January 31, 2025 10:16 — forked from Usman2k19/index.html
Mouse hover water effect
<canvas id="canvas"></canvas>
<div id="wrapper">
</div>
@AnoRebel
AnoRebel / water_ripple_canvas.js
Created January 31, 2025 10:15 — forked from StuPig/water_ripple_canvas.js
Use JavaScript and canvas to create water ripple effect
/*
* Water Canvas by Almer Thie (http://code.almeros.com).
* Description: A realtime water ripple effect on an HTML5 canvas.
* Copyright 2010 Almer Thie. All rights reserved.
*
* Example: http://code.almeros.com/code-examples/water-effect-canvas/
* Tutorial: http://code.almeros.com/water-ripple-canvas-and-javascript
*/
@AnoRebel
AnoRebel / jumpp14-rippless.js
Created January 31, 2025 10:12
Water ripples effect by github.com/jumpp14
const canvas = document.getElementById('canvas');
const canvasContext = canvas.getContext('2d');
let columns, rows, current = [], previous = [], damping = 0.99, isMouseDown = false, isStarted = false;
const make2DArray = (array, columns, rows) => {
for(let i = 0; i < rows; i++){
array.push([]);
for(let j = 0; j < columns * 4; j++){
if(j % 4 == 3){
// specifies the color is fully opaque
@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 {