List of helpful shortcuts for faster coding
If you have any other helpful shortcuts, feel free to add in the comments of this gist :)
export const loginSchema = { | |
email(value) { | |
if (!value) { | |
return 'Este campo es obligatorio'; | |
} | |
// si es un email válido | |
const regex = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i; | |
if (!regex.test(value)) { | |
return 'Email no válido'; | |
} |
"use client" | |
import * as React from "react" | |
import { buttonVariants } from "@/components/ui/button" | |
import { ScrollArea } from "@/components/ui/scroll-area" | |
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" | |
import { cn } from "@/lib/utils" | |
import { ChevronLeft, ChevronRight } from "lucide-react" | |
import { DayPicker, DropdownProps } from "react-day-picker" |
{ | |
// Sets the colors used within the text area. | |
// The value "auto" will switch between the "light_color_scheme" and | |
// "dark_color_scheme" based on the operating system appearance. | |
"color_scheme": "auto", | |
"light_color_scheme": "Breakers.sublime-color-scheme", | |
"dark_color_scheme": "Mariana.sublime-color-scheme", | |
// Note that the font_face and font_size are overridden in the platform | |
// specific settings file, for example, "Preferences (Linux).sublime-settings". |
<?php | |
function custom_in_array(string|int $key, array $arr): bool | |
{ | |
return preg_match('/\b(' . implode("|", array_map(fn($word) => preg_quote($word, "/"), $arr)) . ')\b/i', $key) === 1; | |
} | |
// 800 element | |
$myArray = [ | |
"j8onxb92q6lmuzjmby7e", |
Note: < i=OS 5.1 use
prefs:
. > 5.1 useapp-settings:
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/ | |
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c | |
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit: | |
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1 | |
# New function naming schema: | |
# Verbs: | |
# Get : retrieve full raw data sets | |
# Find : ‘find’ specific data entries in a data set |
URL Schemes | |
Apple | |
Apple Music — music://geo.itunes.apple.com/us/albums/<albumID> | |
– music://geo.itunes.apple.com/us/artists/<artistID> | |
Apple News — applenews:// | |
App Store — itms-apps://itunes.apple.com/app/<appID> | |
Apple TV — videos:// |
aka what i did to get from nothing to done.
note: these are designed to be primarily a re-install guide for myself (writing things down helps me memorize the knowledge), as such don't take any of this on blind faith - some areas are well tested and the docs are very robust, some items, less so). YMMV
package main | |
import ( | |
"fmt"; | |
) | |
func loopit(phrase string, repeat int)(string){ | |
var outputphrase string = ""; |