Skip to content

Instantly share code, notes, and snippets.

View walteh's full-sized avatar

Walter Scott walteh

View GitHub Profile
@JacobWeisenburger
JacobWeisenburger / zustandCustomPersistStorageTemplate.ts
Created March 31, 2023 16:16
Zustand custom persist storage template
import { createStore } from 'zustand'
import { persist, StorageValue } from 'zustand/middleware'
const store = createStore(
persist(
() => ( {} ),
{
name: 'store-state',
storage: {
async getItem ( name: string ): StorageValue<unknown> {
@topfunky
topfunky / add-mozilla-public-license.sh
Created August 16, 2021 17:57
Add Mozilla Public License
#!/usr/bin/env sh
# Download the Mozilla Public License 2.0 and commit it to the current repository.
#
# Author: Geoffrey Grosenbach <[email protected]>
# Date: August 16, 2021
curl https://www.mozilla.org/media/MPL/2.0/index.48a3fe23ed13.txt -o LICENSE.txt
git add LICENSE.txt
@bollwyvl
bollwyvl / LICENSE
Last active January 29, 2025 17:22
Towards a JSON Schema for the Language Server Protocol
Copyright 2019 dead pixels collective
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
@GeorgeLyon
GeorgeLyon / Rust vs. Swift.md
Last active September 12, 2024 12:05
A list of advantages Swift has over Rust

Note This is a little out of date. Rust has made some progress on some points, however many points still apply.

Philosophy

Progressive disclosure

Swift shares Rust's enthusiasm for zero-cost abstractions, but also emphasizes progressive disclosure. Progressive disclosure requires that language features should be added in a way that doesn't complicate the rest of the language. This means that Swift aims to be simple for simple tasks, and only as complex as needed for complex tasks.

The compiler works for you

@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule