Skip to content

Instantly share code, notes, and snippets.

View program247365's full-sized avatar
💭
YOLO 💯

Kevin Ridgway program247365

💭
YOLO 💯
View GitHub Profile
@surpher
surpher / rust_to_swift.md
Last active April 11, 2025 03:03
Building binaries from Rust to iOS/macOS (PactSwift specific)
@drewbrokke
drewbrokke / git-fuzzy-checkout
Last active April 4, 2025 13:42
Fast git checkout using `fzf`
#!/bin/bash
# Requires 'fzf'
# check_dependency fzf git || exit 1
HELP_TEXT="
git fuzzy-checkout
Check out branches quickly with the power of \`fzf\`.
Default view is local branches (HEADS).
@LukeMathWalker
LukeMathWalker / audit.yml
Last active April 26, 2025 03:29
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
@tigt
tigt / git-branch-to-favicon.js
Created March 18, 2020 21:10
Creates an SVG string that can be used as a favicon across different Git branches. Actually getting this into the browser is sadly project-specific.
const { execSync } = require('child_process')
const { createHash } = require('crypto')
const invertColor = require('invert-color')
const branchName = execSync('git rev-parse --abbrev-ref HEAD')
const hash = createHash('sha256')
hash.update(branchName)
const color = '#' + hash.digest().toString('hex').substring(0, 6)
const invertedColor = invertColor(color, true)
@tomhicks
tomhicks / plink-plonk.js
Last active November 12, 2024 19:08
Listen to your web pages
#!/usr/bin/env python3
"""
This processes TiddlyWiki dumps to stick them into a format that Bear can import.
Full steps:
* First in your TiddlyWiki under the Tools menu click "export all>Static HTML".
* Next, run this command `process_tiddly_export --tiddler_dump_file=somewhere/tiddlers.html --output_directory=/tmp/some_empty_folder/ --extra_tags=any,tags,you,want` it will
* process the static HTML file into one file per tiddler
* each file will start with <h1>your tiddler title</h1>
* next it will list any #tags on the original tiddler as well as and extra tags you supplied

User authentication system

Your task is now to create a user authentication system.

This document will guide you through all the features and implication of such system, so that you don't have to search them yourself.

We will focus on web/browser-technologies, however similar concept can be widely applied. This guide, is a work in progress, feel free to comment and provide feedbacks.

Expected Workflows

const React = require('react')
const ReactDOMServer = require('react-dom/server')
const { createServer } = require('http')
const App = require('./build/static/js/main.49fed57c').default
createServer((req, res) => {
const el = React.createElement(App)
const html = ReactDOMServer.renderToString(el)
res.write(html)
res.end()
@mfellner
mfellner / graphql.ts
Created July 8, 2019 20:42
Using Apollo Server in Next.js 9 with API route in pages/api/graphql.ts
import { ApolloServer, gql } from 'apollo-server-micro';
const typeDefs = gql`
type Query {
sayHello: String
}
`;
const resolvers = {
Query: {
import React, { useEffect } from "react"
import useFetch from "./useFetch"
export default function ProcessingPurchase({
send,
context: { workshopData, ticketsToPurchase, stripeToken }
}) {
let [charge, error] = useFetch("/purchaseWorkshop", {
workshopId: workshopData.id,
ticketsToPurchase,