Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🦮
Golden

Davo Galavotti davo

🦮
Golden
View GitHub Profile
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 19 19:57:38 2020
@author: timallan
"""
import random
import time
@corbin-c
corbin-c / table2json.js
Created April 7, 2020 07:05
bookmarklet to scrape a html table to json
javascript:
(async () => {
let parentType = (element,type) => {
if (element.nodeName.toLowerCase() == type.toLowerCase()) {
return element;
} else if (element.parentElement != null) {
return parentType(element.parentElement,type);
} else {
return false;
}
@akella
akella / setup.md
Last active April 15, 2025 10:38
My Setup
@addisonschultz
addisonschultz / generatePropertyControls.ts
Last active July 15, 2023 23:17
Reuse Property Controls easily in Framer X
import { ControlType, PropertyControls } from "framer";
export function generatePropertyControls(
options: {
hidden?: (props: any) => boolean;
omittedProperties?: string[];
} = {}
): PropertyControls {
const properties: PropertyControls = {
// Property Controls go here
@ajorpheus
ajorpheus / cloudTrailEventNames.list
Created September 5, 2019 14:39 — forked from pkazi/cloudTrailEventNames.list
List of values for parameter EventName in AWS Cloudtrail events
AbortDocumentVersionUpload
AbortEnvironmentUpdate
AbortMultipartUpload
AbortVaultLock
AcceptAccountMapping
AcceptCertificateTransfer
AcceptDelegate
AcceptDirectConnectGatewayAssociationProposal
AcceptFxPaymentCurrencyTermsAndConditions
AcceptHandshake
import * as React from "react"
import { useState } from "react"
import {
Frame,
AnimatePresence,
Stack,
Color,
StackProperties,
ControlType,
addPropertyControls,
@adrienkaiser
adrienkaiser / create_nurbs_camera_path.py
Created July 15, 2019 10:03
Blender script to generate a NURBS curve from a camera's path.
import bpy
from mathutils import Vector
# Create the curve data
# https://blender.stackexchange.com/a/6751
curveData = bpy.data.curves.new('CameraCurve', type='CURVE')
curveData.dimensions = '3D'
curveData.resolution_u = 2
curveData.bevel_depth = 0.01 # curve radius in meters
polyline = curveData.splines.new('NURBS')
@steveruizok
steveruizok / Resizer.tsx
Created June 19, 2019 08:38
A Framer X Code Component that will resize to fit its text content.
import * as React from "react"
import {
Frame,
FrameProps,
useMotionValue,
addPropertyControls,
ControlType,
} from "framer"
type Props = FrameProps & {
@s1u
s1u / render28.py
Last active June 8, 2022 00:57 — forked from cloutsocks/render.py
GPU rendering script for Blender 2.8
import bpy
# Mark all scene devices as GPU for cycles
bpy.context.scene.cycles.device = 'GPU'
print("--------------- SCENE LIST ---------------")
for scene in bpy.data.scenes:
print(scene.name)
scene.cycles.device = 'GPU'
scene.render.resolution_percentage = 200
@swyxio
swyxio / createCtx-noNullCheck.tsx
Last active May 4, 2023 02:15
better createContext APIs with setters, and no default values, in Typescript. this is documented in https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/blob/master/README.md#context
// create context with no upfront defaultValue
// without having to do undefined check all the time
function createCtx<A>() {
const ctx = React.createContext<A | undefined>(undefined)
function useCtx() {
const c = React.useContext(ctx)
if (!c) throw new Error("useCtx must be inside a Provider with a value")
return c
}
return [useCtx, ctx.Provider] as const