Skip to content

Instantly share code, notes, and snippets.

@mjbalcueva
mjbalcueva / password-input.tsx
Last active May 9, 2024 14:30
shadcn ui custom password input
"use client"
import { forwardRef, useState } from "react"
import { EyeIcon, EyeOffIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import { Input, InputProps } from "@/components/ui/input"
import { cn } from "@/lib/utils"
const PasswordInput = forwardRef<HTMLInputElement, InputProps>(
({ className, ...props }, ref) => {
@MasonSlover
MasonSlover / SFSymbolTitles.swift
Last active May 9, 2024 14:30
A .swift file with all SF Symbols titles in arrays, separated by category for app development and icon selection
//The following file has 20 arrays, allSymbols[] has the title of every SFSymbol, and the remaining 19 arrays have the following categories:
//communication, weather, objectsAndTools, devices, connectivity, transportation, human, nature, editing, textFormatting, media, keyboard, commerce, time, health, shapes, arrows, indicies, math
private var allSymbols = ["0.circle", "00.circle", "0.circle.fill", "00.circle.fill", "0.square", "00.square", "0.square.fill", "00.square.fill", "1.circle", "01.circle", "1.circle.fill", "01.circle.fill", "1.magnifyingglass", "1.square", "01.square", "1.square.fill", "01.square.fill", "2.circle", "02.circle", "2.circle.fill", "02.circle.fill", "2.square", "02.square", "2.square.fill", "02.square.fill", "3.circle", "03.circle", "3.circle.fill", "03.circle.fill", "3.square", "03.square", "3.square.fill", "03.square.fill", "4.alt.circle", "4.alt.circle.fill", "4.alt.square", "4.alt.square.fill", "4.circle", "04.circle", "4.circle.fill", "04.circle.fill", "4.square", "04.square", "4
@James-Leslie
James-Leslie / jupyter-envs.md
Created October 5, 2020 07:12
How to add conda environment to jupyter lab

How to add conda environments to JupyterLab

Credit for this goes to the Stack Overflow user Statistic Dean for his post on this question

1. Install nb_conda_kernels into your base environment

(base)$ conda install -c conda-forge nb_conda_kernels

2. Activate desired environment and install ipykernel

@jboner
jboner / latency.txt
Last active May 9, 2024 14:20
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@RealMuffinTime
RealMuffinTime / better_log4j_config.xml
Last active May 9, 2024 14:16
Custom log4j config for fabric servers using Better Log4j Config mod
<?xml version="1.0" encoding="UTF-8"?>
<!-- Custom log4j config for fabric servers -->
<!-- https://modrinth.com/mod/better-log4j-config -->
<!-- Entire configuration reloads from disk every 10 seconds -->
<Configuration status="WARN" packages="com.mojang.util,net.minecrell.terminalconsole.util" monitorInterval="10">
<Appenders>
<!-- System out -->
@mpppk
mpppk / clean_architecture.md
Last active May 9, 2024 14:16
クリーンアーキテクチャ完全に理解した

2020/5/31追記: 自分用のメモに書いていたつもりだったのですが、たくさんのスターを頂けてとても嬉しいです。
と同時に、書きかけで中途半端な状態のドキュメントをご覧いただくことになっており、大変心苦しく思っています。

このドキュメントを完成させるために、今後以下のような更新を予定しています。

  • TODO部分を埋める
  • 書籍を基にした理論・原則パートと、実装例パートを分割
    • 現在は4層のレイヤそれぞれごとに原則の確認→実装時の課題リスト→実装例という構成ですが、同じリポジトリへの言及箇所がバラバラになってしまう問題がありました。更新後は、実装時の課題リストを全て洗い出した後にまとめて実装を確認する構成とする予定です。

2021/1/22追記:

@karpathy
karpathy / min-char-rnn.py
Last active May 9, 2024 14:16
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@rodrigoborgesdeoliveira
rodrigoborgesdeoliveira / ActiveYouTubeURLFormats.txt
Last active May 9, 2024 14:15 — forked from ScottCooper92/gist:ea11b690ba4b1278e049
Example of the YouTube videos URL formats
http://www.youtube.com/watch?v=-wtIMTCHWuI
http://youtube.com/watch?v=-wtIMTCHWuI
http://m.youtube.com/watch?v=-wtIMTCHWuI
https://www.youtube.com/watch?v=lalOy8Mbfdc
https://youtube.com/watch?v=lalOy8Mbfdc
https://m.youtube.com/watch?v=lalOy8Mbfdc
http://www.youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail
http://youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail
http://m.youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail