Skip to content

Instantly share code, notes, and snippets.

@mxkaske
mxkaske / columns.tsx
Last active November 18, 2024 18:53
@tanstack/table filterFns example for date range (between days and same day)
"use client";
import type { ColumnDef } from "@tanstack/react-table";
import type { ColumnSchema } from "./schema";
import { format } from "date-fns";
export const columns: ColumnDef<ColumnSchema>[] = [
{
accessorKey: "date",
header: "Date",
@tsemachh
tsemachh / Media.ts
Last active August 20, 2024 05:24
PayloadCms 3.00 Thumbnail for video asset
import path from 'path'
import { fileURLToPath } from 'url'
import { type CollectionConfig } from 'payload'
import { videoCoverImage } from './hooks/videoCoverImage'
/* eslint-enable */
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
@tyteen4a03
tyteen4a03 / JobStopsListenerField.tsx
Last active January 3, 2025 16:31
PayloadCMS Listener Field Pattern (v3)
import JobStopsListenerFieldEffect from "@/modules/transport/components/JobStopsListenerField/JobStopsListenerFieldEffect";
import type { UIFieldServerComponent } from "payload";
const JobStopsListenerField: UIFieldServerComponent = async ({ payload }) => {
const warehouse =
(
await payload.find({
collection: "addresses",
where: {
type: {
@ctrlaltdylan
ctrlaltdylan / [[...slug.js]].js
Created February 25, 2021 13:44
Bullboard with Next JS
import nc from "next-connect";
const { setQueues, BullAdapter, router } = require("bull-board");
import emailQueue from 'queues/emailQueue'; // or wherever your queues lie
setQueues([
new BullAdapter(emailQueue),
]);
const handler = nc().use(
@apisandipas
apisandipas / De-quarantine an app on MacOS
Last active December 28, 2024 22:20
De-quarantine an app on MacOS
codesign --sign - --force --deep /Applications/VSCodium.app
xattr -d com.apple.quarantine /Applications/VSCodium.app
@darconeous
darconeous / tesla-key-card-protocol.md
Last active September 9, 2025 07:58
Tesla Key Card Protocol

Tesla Key Card Protocol

Researched by Robert Quattlebaum [email protected].

Last updated 2020-02-03.

Image of Tesla Key Card Image of Tesla Model 3 Key Fob

adb shell
//电源键
adb shell input keyevent 26
//菜单键
adb shell input keyevent 82
//home键
adb shell input keyevent 3
//返回键
adb shell input keyevent 4
@bxcodec
bxcodec / _struct_to_map.go
Last active July 31, 2024 21:43
Golang Struct To Map Example By JSON tag
/*
This function will help you to convert your object from struct to map[string]interface{} based on your JSON tag in your structs.
Example how to use posted in sample_test.go file.
*/
func structToMap(item interface{}) map[string]interface{} {
res := map[string]interface{}{}
if item == nil {
return res
}
@Willian-Zhang
Willian-Zhang / tensorflow_1_8_high_sierra_gpu.md
Last active May 12, 2022 04:40
Install TensorFlow 1.8 on macOS High Sierra 10.13.4 with CUDA
@branflake2267
branflake2267 / main.dart
Created March 3, 2018 21:32
Flutter - Using the future builder with infinite list view.
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(