Skip to content

Instantly share code, notes, and snippets.

View robertvanhoesel's full-sized avatar

Robert van Hoesel robertvanhoesel

View GitHub Profile
@robertvanhoesel
robertvanhoesel / gist:b314e8a77f1be7074f046260d8bcb99e
Created March 31, 2023 16:31
Cloning just one extension with sparse-checkout
https://github.blog/2020-01-17-bring-your-monorepo-down-to-size-with-sparse-checkout/
git clone --filter=blob:none --no-checkout https://github.com/raycast/extensions.git
git sparse-checkout set --cone
git sparse-checkout set extensions/spotify-beta
git checkout @peduarte/spotify-beta
@robertvanhoesel
robertvanhoesel / json-param.ts
Created June 7, 2022 16:45
Format and parse objects in a single url query param
export type JsonParamPrimitiveValue = string | number | boolean | null;
export type JsonParamObject = Record<string, JsonParamPrimitiveValue | JsonParamPrimitiveValue[]>;
export type JsonParamValue = JsonParamPrimitiveValue | JsonParamValue[] | JsonParamObject;
export type JsonParam = Record<string, JsonParamValue>;
function formatValue(value: JsonParamValue): string {
if (typeof value == 'number') return `${value}`;
else if (value === null) return 'null';
else if (typeof value == 'boolean' && value) return undefined;
else if (typeof value == 'boolean') return 'false';

Keybase proof

I hereby claim:

  • I am robertvanhoesel on github.
  • I am robertvh (https://keybase.io/robertvh) on keybase.
  • I have a public key whose fingerprint is D1CF 02E0 4BB5 C643 20E0 34A9 806F DCEB B51D F15E

To claim this, I am signing this object:

@robertvanhoesel
robertvanhoesel / designComponentsDropdown.tsx
Created August 27, 2018 17:07
Retrieve all Design Components in a Framer X document
import * as React from "react";
import { PropertyControls, ControlType } from "framer";
// Step 1: Import all exported values and put them on designComponents variable
import * as designComponents from "./canvas";
// Step 2. Filter out the functions only (skip the __info__ variable)
// In the future this might need better typechecking might canvas.ts change
const components = Object.keys(designComponents).filter(
k => typeof designComponents[k] == "function"
@robertvanhoesel
robertvanhoesel / Keyboard.ts
Created August 23, 2018 19:59
Make any keyboard design in Framer interactive, using the text on the button as input onTap
import { Override, Data } from "framer";
const app = Data({ Text: "" });
export const Input: Override = props => {
return {
text: app.Text.length > 0 ? app.Text : "Type something...",
opacity: app.Text.length > 0 ? 1 : 0.6
};
};
@robertvanhoesel
robertvanhoesel / simple-md.js
Last active September 11, 2017 21:43
Crowded's simple but bulletproof markdown filter
/**
Copyright (c) 2017 Crowded. All rights reserved.
This work is licensed under the terms of the MIT license.
For a copy, see <https://opensource.org/licenses/MIT>.
**/
function simpleMd(text) {
var text = String(text);