This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas id="canvas"></canvas> | |
<div id="wrapper"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 $$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { type Ref, ref } from "vue"; | |
import type { | |
IConfig, | |
ILocations, | |
IOptions, | |
IRipples, | |
IUniforms, | |
} from "./types"; | |
import { |
NewerOlder