Skip to content

Instantly share code, notes, and snippets.

View Debdut's full-sized avatar
💭
Chill

Debdut Karmakar Debdut

💭
Chill
View GitHub Profile
@alexwidua
alexwidua / ContentView.swift
Created July 4, 2023 17:07
SwiftUI Grid Animation
import SwiftUI
// 1. Use looped H/VStacks to create a grid
// 2. Conditionally increase spacing to grow/shrink the grid
// 3. Calculate the distance of each dot to the center and use the value to stagger the animation
//4. Add random delay on top of the staggered delay value
struct ContentView: View {
// const & state
@dangovorenefekt
dangovorenefekt / blockmetatwitter.md
Last active May 9, 2024 23:39
Block Meta and Twitter (nginx)
const CH_BRACE_L = 0x7b as const;
const CH_BRACE_R = 0x7d as const;
const CH_SQUARE_L = 0x5b as const;
const CH_SQUARE_R = 0x5d as const;
const CH_QUOTE_D = 0x22 as const;
const CH_ESCAPE = 0x5c as const;
const CH_COMMA = 0x2c as const;
const CH_COLON = 0x3a as const;
const CH_DOT = 0x2e as const;
const CH_MINUS = 0x2d as const;
@kconner
kconner / macOS Internals.md
Last active May 22, 2024 15:55
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@larsaugustin
larsaugustin / RetroDock.swift
Created May 26, 2021 15:33
A macOS dock replacement with a modernized version of the design used before Yosemite
import SwiftUI
// MARK: - Constants
// Items in the dock: Add any application you’d like to see in here
let items =
[
"file:///Applications/Xcode.app",
"file:///Applications/Safari.app",
"file:///System/Applications/Messages.app",
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@JoeyBurzynski
JoeyBurzynski / active_os.sh
Last active January 25, 2023 22:36
Determine Active Operating System in Bash Script
#!/usr/bin/env bash
# * Determine operating system via $OSTYPE
function active_operating_system_ostype() {
echo
echo "Determining active operating system via \$OSTYPE"
echo " » \$OSTYPE output: $OSTYPE"
local active_os
@elsangedy
elsangedy / useCombineReducer.js
Created September 5, 2019 16:54
useCombineReducer
import { useMemo, useCallback, useReducer as useReducerBase } from "react";
export function useCombineReducer(initialState, ...reducers) {
const internalReducer = useCallback(
(state, action) => ({
...state,
...reducers.reduce(
(prev, current, idx) =>
idx === 0
? current(state, action, initialState)
/*
Convert GoogleDoc To HTML (on Google Drive )
Converting a Google Document to simple HTML
http://collaborative-tools-project.blogspot.co.uk/2013/06/converting-google-document-to-simple.html
*/
function test_convertGoogleDoc(){