Skip to content

Instantly share code, notes, and snippets.

@mmiszy
mmiszy / Button.tsx
Created February 12, 2024 10:22
`asChild` pattern in React
import { clsx } from "clsx";
import { type ButtonHTMLAttributes } from "react";
import { Slot } from "./Slot";
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
asChild?: boolean;
children: React.ReactNode;
}
export const Button = ({ asChild = false, ...props }: ButtonProps) => {
@nicolasdao
nicolasdao / open_source_licenses.md
Last active April 23, 2024 23:27
What you need to know to choose an open source license.
@alexf101
alexf101 / generate_dependabot_config.rb
Last active April 23, 2024 23:27
Translates a Dependabot config with glob support to a real Dependabot config
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'httparty'
gem 'fast_ignore'
end
require 'httparty'
@harperreed
harperreed / peter-thiels-cs183-startup-class-01-notes-essay.md
Created July 29, 2012 21:20
Notes Essays—Peter Thiel’s CS183: Startup—Stanford, Spring 2012

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble

@tfhartmann
tfhartmann / sqs.py
Created February 12, 2014 14:02
Example script on how to poll a AWS SQS Queue and pull off messages
#!//opt/boxen/homebrew/bin/python
import boto.sqs
from boto.sqs.message import RawMessage
import json
import time
import requests
REGION = 'us-west-2'
@adrianhajdin
adrianhajdin / index.css
Created November 11, 2021 13:19
Build and Deploy a Fully Responsive Website with Modern UI/UX in React JS
.gpt3__whatgpt3 {
display: flex;
flex-direction: column;
padding: 2rem;
background: var(--color-footer);
/* ff 3.6+ */
background:-moz-radial-gradient(circle at 30% -100%, #042c54 25%, rgba(4, 44, 84, 1) 85%, rgba(27, 120, 222, 1) 100%);
@YodaheaD
YodaheaD / MsalWrapper
Created August 30, 2023 21:00
MSAL wrapper component for NextJS apps
"use client";
import { MsalProvider } from "@azure/msal-react";
import { msalInstance } from "../../config/msal";
import React from "react";
type Props = {
children?: React.ReactNode;
};
@slavfox
slavfox / sample
Created February 16, 2020 16:43
Cozette sample file
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ♡ Cozette ♡ ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ A B C D E F G H I J K L M │
│ N O P Q R S T U V W X Y Z │
╞═══════════════════════════╡
│ 1 2 3 4 5 6 7 8 9 0 │
╞═══════════════════════════╡
@willurd
willurd / web-servers.md
Last active April 23, 2024 23:07
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@alfchee
alfchee / NumeroALetras.js
Last active April 23, 2024 23:04
Código en JavaScript que convierte números a letras, bastante útil para formularios de documentos contables y similares
/*************************************************************/
// NumeroALetras
// The MIT License (MIT)
//
// Copyright (c) 2015 Luis Alfredo Chee
//
// 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