Skip to content

Instantly share code, notes, and snippets.

@ShinyObjectLabs
ShinyObjectLabs / BaseForm.tsx
Last active April 18, 2024 19:10
Framer Form Component
/*
MIT License
Copyright © Joel Whitaker
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@taktran
taktran / README.md
Last active April 18, 2024 19:08
Extract Chat GPT Logs

Extract Chat GPT Logs

Made this to help me extract Chat GPT logs, for future reference.

Chat GPT did help in helping me write this :)

To use

@Overemployed
Overemployed / install.sh
Last active April 18, 2024 19:08
Jacktrip running on PiKVM / Raspberry Pi with arch distro
#!/bin/bash
# Check if script is running as root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# your personal machine running jacktrip
REMOTE_JACK_SERVER=nat.local
@izimin
izimin / GetHtmlContentByUrl.java
Last active April 18, 2024 19:07
HTML content by URL
private static String getHtmlContentByUrl(String url) {
String content = null;
URLConnection connection;
try {
connection = new URL(url).openConnection();
Scanner scanner = new Scanner(connection.getInputStream());
scanner.useDelimiter("\\Z");
content = scanner.next();
} catch (Exception ex) {
ex.printStackTrace();
@mjbalcueva
mjbalcueva / password-input.tsx
Last active April 18, 2024 19:05
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) => {
@Reacoder
Reacoder / edittext.java
Created August 5, 2014 05:27
EditText onClick event is not triggering
When a user interacts with a UI element the various listeners are called in a top down order. (For example: OnTouch -> OnFocusChange -> OnClick.) If a listener has been defined (with setOn...Listener) and it consumes this event: the lower priority listeners will not be called. By its nature the first time you touch an EditText it receives focus with OnFocusChangeListener so that the user can type. The action is consumed here therefor OnClick is not called. Each successive touch doesn't change the focus so the event trickles down to the OnClickListener.
Basically, you have three choices:
Set the focusable attribute to false in your XML:
android:focusable="false"
Now the OnClickListener will fire every time it is clicked. But this makes the EditText useless since the user can no longer enter any text...
Implement an OnFocusChangeListener along with the OnClickListener:
easyweb-italia
4764fbb159e067e22458285444e844c313f26d6d
@RednibCoding
RednibCoding / 0 Odin debugging on windows.md
Last active April 18, 2024 19:04
Odin debugging on windows with vscode. See: readme

To setup debugging for Odin programs on Windows with VsCode follow these steps:

  • make sure you have the C/C++ extension pack (VsCode extension) installed
  • create a .vscode folder at the root of your Odin project
  • copy the launch.json and tasks.json into it
  • click on the debug tab in VsCode, then click on the debug button at the top (or press F5)
@vlas-voloshin
vlas-voloshin / delete-duplicate-sims.rb
Last active April 18, 2024 19:04
Script for deleting duplicate iOS simulators and fixing simulators list in Xcode
#!/usr/bin/env ruby
# What is this for?
# This script fixes an issue appeared for some Xcode users where it would show long identifiers
# in the list of simulators instead of usual short names. This is caused by duplicate simulators
# being sometimes created after switching between Xcode versions, with the same
# device type + runtime pair occurring more than once in your list of available simulators.
# Instead of showing the same simulator name twice, Xcode defaults to simulator identifiers.
#
# What it does?
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 18, 2024 19:04
set -e, -u, -o, -x pipefail explanation