Skip to content

Instantly share code, notes, and snippets.

View lrw04's full-sized avatar
🏳️‍⚧️
Pride

小型移动夸夸猫咖 lrw04

🏳️‍⚧️
Pride
View GitHub Profile
import math
def sin(x):
if isinstance(x, Dual):
return Dual(sin(x.x), cos(x.x) * x.dx)
return math.sin(x)
def cos(x):
if isinstance(x, Dual):
return Dual(cos(x.x), -1 * sin(x.x) * x.dx)
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active June 2, 2024 11:24
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@evilactually
evilactually / CMakeLists.txt
Created August 8, 2016 21:00
Compiling GLSL to SPIR-V from CMake
if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "AMD64")
set(GLSL_VALIDATOR "$ENV{VULKAN_SDK}/Bin/glslangValidator.exe")
else()
set(GLSL_VALIDATOR "$ENV{VULKAN_SDK}/Bin32/glslangValidator.exe")
endif()
file(GLOB_RECURSE GLSL_SOURCE_FILES
"shaders/*.frag"
"shaders/*.vert"
)
#!r6rs
(library (toys quasiquote)
(export quasiquote
unquote
unquote-splicing
)
(import (except (rnrs) quasiquote unquote unquote-splicing))
(define-syntax unquote
(lambda (stx)