Skip to content

Instantly share code, notes, and snippets.

View program247365's full-sized avatar
💭
YOLO 💯

Kevin Ridgway program247365

💭
YOLO 💯
View GitHub Profile
@JohnBra
JohnBra / GlowingGradientBorderButton.tsx
Last active September 15, 2023 16:14
A TailwindCSS glowing gradient border button
import React from 'react'
function cn(...classes: any[]) {
return classes.filter(Boolean).join(' ')
}
type Props = {
gradient: string // 'bg-gradient-to-r from-red-600 via-purple-600 to-blue-600',
children: React.ReactNode
href: string
const minute = 60;
const hour = minute * 60;
const day = hour * 24;
const week = day * 7;
const month = day * 30;
const year = day * 365;
/**
* Convert a date to a relative time string, such as
* "a minute ago", "in 2 hours", "yesterday", "3 months ago", etc.
@juancsr
juancsr / mac-docker-withot-docker-destop.md
Last active April 17, 2024 15:05
Use docker in mac without docker-
@tforster
tforster / index.js
Last active December 23, 2023 00:25
Naked Redirector CloudFront Function
/**
* @description: Handler entry point.
* - Note AWS CloudFront Functions use a modified ECMAScript 5.1 compatible runtime and NOT NodeJS.
* - Use var, not const or let
* - Use string concatenation and not template literals
* - Beware that the CloudFront Functions Console editor and test environment do NOT mimic CloudFront 100%
* @date 2022-01-26
* @param {object} event: A CloudFront Function event (expecting a Viewer Request event)
* @return {object}: A CloudFront response or request object (depends whether conditions allow pass through or 301 redirect)
*/
@steve8708
steve8708 / intercom-facade.tsx
Created November 12, 2021 17:46
Intercom Facade - render a placeholder of the intercom button that doesn't load the heavy widget JS until clicked. Boosted our lighthouse score ~15 points
const INTERCOM_KEY = /* YOUR KEY HERE */;
export function IntercomFacade() {
return (
<div className="intercom-lightweight-app" aria-live="polite">
<style>{INTERCOM_STYLE}</style>
<div
className="intercom-lightweight-app-launcher intercom-launcher"
role="button"
tabIndex={0}
@linkdd
linkdd / hackernews-new-comms.js
Last active September 20, 2021 22:52
Add a bell emoji to unread comments on HackerNews
// Can be used with https://github.com/xcv58/Custom-JavaScript-for-Websites-2
// This snippet is released under the terms of the CC0 license: https://creativecommons.org/publicdomain/zero/1.0/deed.en
const cache_key = 'hn_comments_views'
const cache = JSON.parse(localStorage.getItem(cache_key) || '{}')
document.querySelectorAll('.athing.comtr').forEach(comm => {
if (!cache[comm.id]) {
const span = document.createElement('span')
span.innerHTML = '&#x1f514;' // :bell: emoji
@shirakaba
shirakaba / README.md
Last active November 17, 2023 00:52
GUI-based debugging of iOS/macOS Rust projects in Xcode

Here's how to get your environment set up to:

  1. Develop iOS and Android apps using Rust.
  2. Enable GUI debugging of Rust projects in Xcode.

If you just want to enable GUI debugging of macOS Rust projects in Xcode, I'm not actually sure whether you need cargo-mobile at all. But one benefit of installing it is that it automatically installs rust-xcode-plugin for you, giving you syntax highlighting of Rust sources in Xcode.

Prerequisites

cargo-mobile

@farmanp
farmanp / setup.sh
Last active February 16, 2023 16:48 — forked from bradp/setup.sh
Onboarding Mac Setup Script
# Overview of this script is running an automated installation workflow that goes step by step below:
# 1. Github setup
# 2. Install XCode
# 3. Install Homebrew
# 4. Install Development tools (programming languages, libraries, etc)
# 5. Setting up Mac settings
# Done!
developer_utilities_setup() {
echo "Installing tree, wget, trash, mackup, and node..."
@hendi
hendi / rocket-sqlx.rs
Last active February 4, 2024 05:23
Rust: rocket with sqlx
#[macro_use] extern crate rocket;
use std::env;
use anyhow::Result;
use rocket::State;
use rocket::http::Status;
use sqlx::{Pool, Postgres};
@surpher
surpher / rust_to_swift.md
Last active April 25, 2024 12:30
Building binaries from Rust to iOS/macOS (PactSwift specific)