Skip to content

Instantly share code, notes, and snippets.

View cyupa's full-sized avatar
🎯
Focusing

Ciprian Redinciuc cyupa

🎯
Focusing
View GitHub Profile
@mrmartineau
mrmartineau / stimulus.md
Last active May 16, 2025 13:02
Stimulus cheatsheet
@bnjamin
bnjamin / bare_transitions.js
Created June 23, 2020 10:28
Transitions stolen from alpine.js
export function transitionIn (el, show = () => {}) {
const attrs = getXAttrs(el, 'transition')
// If any transition attrs.
if (attrs.filter(attr => ['enter', 'enter-start', 'enter-end'].includes(attr.value)).length > 0) {
transitionClassesIn(el, attrs, show)
} else {
// If not, just show that damn thing.
show()
}
@mabenson00
mabenson00 / cheatsheet.rb
Last active July 10, 2025 13:23
Rails Postgres ActiveRecord JSON cheatsheet
# Basic key operators to query the JSON objects :
# #> : Get the JSON object at that path (if you need to do something fancy)
# -> : Get the JSON object at that path (if you don't)
# ->> : Get the JSON object at that path as text
# {obj, n} : Get the nth item in that object
# https://www.postgresql.org/docs/9.4/functions-json.html#FUNCTIONS-JSONB-OP-TABLE
# Date
# date before today
@philipshen
philipshen / FadeInFullScreenCoverModifier.swift
Last active March 10, 2025 14:29
Fade in full screen cover in Swift
import SwiftUI
struct FadeInFullScreenCoverModifier<V: View>: ViewModifier {
@Binding var isPresented: Bool
@ViewBuilder let view: () -> V
@State var isPresentedInternal = false
func body(content: Content) -> some View {
content