This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import math | |
import bmesh | |
# Always follow these rules | |
# - for every object you create, create it at the origin, size it, then move it if applicable | |
# - always center things (w.r.t the proper axis) when stacking/arranging them | |
# - everythign should be modular and easy to tweak | |
# - put parameters in constants at the top of the file but dont define a fuck ton of conflicting inter-dependant constants just the minimum ones which control the sizing |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# curl -o /usr/local/bin/hqgif https://gist.github.com/bebeal/6fe1ad8c72f0e560780e080188ff28f7/raw/hqgif.sh | |
# chmod +x /usr/local/bin/hqgif | |
# hqgif input.mov [output.gif] | |
# | |
# Converts video files to high-quality GIFs using a two-pass process: | |
# 1. Generates an optimized color palette from the source video | |
# 2. Creates the GIF using the custom palette for better quality | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AsleepFilled, LightFilled } from '@carbon/icons-react'; | |
import { useTheme } from 'next-themes'; | |
import { useCallback, useEffect, useState } from 'react'; | |
const getBoxShadow = (theme?: string, resolvedTheme?: string) => { | |
const isLight = resolvedTheme === 'light'; | |
const baseColor = resolvedTheme !== 'light' ? '#0d1117' : 'white'; | |
const thumbLeft = `calc(1rem * -1) 0 0 2px ${baseColor} inset, 0 0 0 2px ${baseColor} inset`; | |
const thumbMiddle = `calc(1rem / 2) 0 0 2px ${baseColor} inset, calc(1rem / -2) 0 0 2px ${baseColor} inset, 0 0 0 2px ${baseColor} inset`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# to-mp4: batch converts all common video files in a directory to .mp4 format using ffmpeg | |
# | |
# Usage: | |
# convert_all_videos <directory> [--delete] | |
# | |
# Arguments: | |
# <directory> Path to the folder containing video files to convert | |
# --delete Optional flag to delete original files after successful conversion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
# Clear existing mesh objects | |
bpy.ops.object.select_all(action='SELECT') | |
bpy.ops.object.delete(use_global=False) | |
# Bobbin dimensions (all measurements in mm) | |
components = [ | |
{ # Outlet nozzle | |
"name": "Nozzle", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const onClick = useCallback((event: any) => { | |
createRippleEffect(event); | |
}; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { forwardRef } from 'react'; | |
export const codeLanguages = [ | |
'bash', | |
'c', | |
'cpp', | |
'c#', | |
'objective-c', | |
'css', | |
'go', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create plugin to combine KaTeX fonts | |
function combineKatexFonts(): Plugin { | |
return { | |
name: 'combine-katex-fonts', | |
enforce: 'post', | |
apply: 'build', | |
generateBundle(_, bundle) { | |
// Find all KaTeX font files in the bundle | |
const fontFiles = Object.keys(bundle).filter(fileName => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, math | |
import random | |
import gym | |
import numpy as np | |
import torch | |
import torch.nn as nn | |
import torch.optim as optim | |
from gym import spaces | |
import cv2 | |
from collections import deque |
NewerOlder