Skip to content

Instantly share code, notes, and snippets.

@naqvitalha
naqvitalha / LazyScrollView.tsx
Created February 5, 2024 21:56
LazyScrollView
export const LazyScrollView = forwardRef(function LazyScrollView(
props: LazyScrollViewProps,
ref: ForwardedRef<FlashList<unknown[]>>,
): JSX.Element {
const {children, estimatedScrollViewSize, estimatedItemSize} =
props;
const data = isArray(children) ? children : Children.toArray(children);
// No specific reason for 2000, just a big number. Roughly 2x the screen size
@fandean
fandean / .zshrc
Last active May 9, 2024 14:53
Powerlevel9k - .zshrc
# .zshrc 中 p9k 的配置内容
#####################################
# P9k 配色方案: bright、 light、dark(模式下右侧提示符不显示)
POWERLEVEL9K_COLOR_SCHEME='light'
# 在新提示符之前插入一行以保持间距
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
# https://github.com/bhilburn/powerlevel9k/tree/next#customizing-prompt-segments
# LEFT_PROMPT 左侧提示符
@pwm1234
pwm1234 / get_module_path
Last active May 9, 2024 14:51
path to dll containing a function
std::string get_module_path(void* address)
{
char path[FILENAME_MAX];
HMODULE hm = NULL;
if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
(LPCSTR)address,
&hm))
{
@jl2
jl2 / wordgraph.go
Created October 5, 2012 07:59
Use Go and Dot to create a directed graph from a text file. Don't know what this could be used for, but it looks neat.
package main
// Create a directed graph based on the words in a text file.
// For example the sentences "This is some text. What is this good for?" would produce the following digraph:
// digraph graph {
// This -> is
// is -> some
// some -> text
// What -> is
@Clybius
Clybius / index.html
Last active May 9, 2024 14:51
Embed AV1/No File Size Capped Videos in Discord
<head>
<meta property="og:image" content="GifToEmbedURL"> # Change the content to the link of a gif of your choice, which will be shown as the embed.
<meta property="og:type" content="video.other">
<meta property="og:video:url" content="VideoToEmbedURL"> # Change the content to the link of a video of your choice. Will work with videos over 50 MB, and even unsupported codecs such as AV1!
<meta property="og:video:width" content="1920"> # Set this to the video's width and height, not required, but will show the video as intended if the aspect ratio and size is correct.
<meta property="og:video:height" content="1080">
</head>
@juanmc2005
juanmc2005 / diart_whisper.py
Last active May 9, 2024 14:47
Code for my tutorial "Color Your Captions: Streamlining Live Transcriptions with Diart and OpenAI's Whisper". Available at https://medium.com/@juanmc2005/color-your-captions-streamlining-live-transcriptions-with-diart-and-openais-whisper-6203350234ef
import logging
import os
import sys
import traceback
from contextlib import contextmanager
import diart.operators as dops
import numpy as np
import rich
import rx.operators as ops
@rgommers
rgommers / tutorial_KDE.py
Created December 29, 2011 15:15
Kernel Density Estimation with SciPy
# -*- coding: utf-8 -*-
# <nbformat>2</nbformat>
# <markdowncell>
# Kernel Density Estimation with SciPy
# ====================================
# <codecell>
@luckylittle
luckylittle / Splunk_Certified_Cybersecurity_Defense_Analyst.md
Last active May 9, 2024 14:41
Splunk Certified Cybersecurity Defense Analyst [SPLK-5001] - Notes

Splunk Certified Cybersecurity Defense Analyst [SPLK-5001]

1.0 The Cyber Landscape, Frameworks, and Standards (*10%*)
  1.1 Summarize the organization of a typical SOC and the tasks belonging to Analyst, Engineer and Architect roles.
  1.2 Recognize common cyber industry controls, standards and frameworks and how Splunk incorporates those frameworks.
  1.3 Describe key security concepts surrounding information assurance including confidentiality, integrity and availability and basic risk management.

2.0 Threat and Attack Types, Motivations, and Tactics (*20%*)
  2.1 Recognize common types of attacks and attack vectors.
@charlestsai1995
charlestsai1995 / CJK support on Beepy.md
Last active May 9, 2024 14:40
CJK support on Beepy

CJK support on Beepy (both display and input)

The Beepy uses a monochrome sharp memory LCD panel which has some caveat. This document includes a way to bring CJK support to Beepy in the framebuffer. The below is based on raspbian on raspberry pi zero, and had ran the Beepy setup script found on https://beepy.sqfmi.com/docs/getting-started.

Install DRM driver for the LCD

We will be using fbterm. Since fbterm supports minimal of 32bpp, we need to install a DRM driver for the sharp memory LCD panel to enable 32bpp mode.

Download the driver made by excel,

$ git clone https://github.com/ardangelo/sharp-drm-driver.git
@joakimriedel
joakimriedel / !typed mappers (mapGetters, mapActions, mapMutations, mapState) for vuex 4 and vue 3.md
Last active May 9, 2024 14:40
Strictly typed mappers for vuex 4 and vue 3 using Typescript 4.4+

Vuex 4 is a great companion to Vue 3, but Vuex is falling behind on Typescript support. While waiting for better typing support in Vuex 5 or using Pinia, this wrapper might help.

Using this wrapper will correctly infer arguments and return types on your state, actions, getters and mutations.

It works both within your store(s) and any Vue components where you use the mapActions, mapState, mapGetters or mapMutations helpers from Vuex.

No more any will help you find many errors at compile-time!