Skip to content

Instantly share code, notes, and snippets.

@KristofferEriksson
KristofferEriksson / useGesture.ts
Created February 7, 2024 10:27
A custom React Typescript hook for advanced touch gestures in UI
import { useEffect, useRef } from "react";
type GestureType =
| "swipeUp"
| "swipeDown"
| "swipeLeft"
| "swipeRight"
| "tap"
| "pinch"
| "zoom";
@slightfoot
slightfoot / split_bar.dart
Last active March 8, 2022 14:06
Split Bar in Flutter. Lets you touch between two horizontal sections to resize the split point.
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(
primaryColor: Colors.indigo,
accentColor: Colors.pinkAccent,
),
@vincascm
vincascm / triple_des.rs
Last active August 20, 2024 19:13
triple des(3des) ecb pkcs5 padding encrypt/decrypt function for rust, use openssl crypto library.
//! triple des(3des) ecb pkcs5 padding encrypt/decrypt function for rust, use openssl crypto
//! library.
//! refer to <http://blog.csdn.net/lyjinger/article/details/1722570>
//! coded by vinoca.
//! 2017.11.24
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
extern crate libc;
@basham
basham / css-units-best-practices.md
Last active September 5, 2025 10:49
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units