Skip to content

Instantly share code, notes, and snippets.

View smolck's full-sized avatar

smolck

View GitHub Profile
@jharmer95
jharmer95 / rust-to-cpp.md
Last active November 3, 2023 14:52
Translating Rust keywords, concepts, and idioms to C++

Rust to C++

Language Only

Keywords

as

as has a few different contexts in Rust:

@herohiralal
herohiralal / EdgeDetection.shader
Created June 29, 2021 02:20
URP Sobel Edge Detection
Shader "Universal Render Pipeline/Post-Processing/EdgeDetection"
{
Properties
{
[Toggle(ENABLED)] __enabled("Enabled", Float) = 1
[MainTex] [HideInInspector] _MainTex ("Base Map", 2D) = "white" { }
[MainColor] _Color ("Color", Color) = (1, 1, 1, 1)
_Thickness ("Thickness", Float) = 0
@PatOConnor43
PatOConnor43 / after-plugin-_load_lua.vim
Last active August 19, 2022 20:38
This is a minimal example configuration which should allow lua scripts to resolve lua modules that are loaded as a result of packer.nvim. `/` is not allowed as a filename in gist so `-`s are used in their place.
" This was taken from
" https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/after/plugin/_load_lua.vim
let s:load_dir = expand('<sfile>:p:h:h:h')
exec printf('luafile %s/lua/init.lua', s:load_dir)
; lie to gist that this is clojure for syntax highlighting
; vim: ft=clojure
(require-macros :meta-macros)
(local (mpack Session Tcp Socket) (values (require :mpack)
(require :nvim.session)
(require :nvim.tcp_stream)
(require :nvim.socket_stream)))
(local (fmt join) (values string.format table.concat))
; an api.mpack file needs to be generated from /path/to/neovim/scripts/vim_gendoc.py
@chrisdone
chrisdone / DBAPI.hs
Last active April 10, 2022 07:26
Defaulting fields in a record in Haskell
{-# LANGUAGE DataKinds #-}
-- | My database API.
module DBAPI where
import Data.Defaults
data ConnSpec p = ConnSpec
{ username :: !(Required p String)
@sgon00
sgon00 / dart.vim
Created December 4, 2018 09:50
Put it at `~/.vim/after/syntax/dart.vim` to add/override anything in `~/.vim/bundle/dart-vim-plugin/syntax/dart.vim`.
syn match dartFunction "\zs\(\k\w*\)*\s*\ze("
hi! link dartFunction Function
syn match myCamelCase '\v(<_*\u\i*>)+'
hi! link myCamelCase Type
syntax keyword flutterConstant immutable kAlwaysCompleteAnimation kAlwaysDismissedAnimation
\ kBackMouseButton kBottomNavigationBarHeight kDoubleTapMinTime kDoubleTapSlop kDoubleTapTimeout
\ kDoubleTapTouchSlop kElevationToShadow kFloatingActionButtonMargin kFloatingActionButtonSegue
\ kFloatingActionButtonTurnInterval kForwardMouseButton kHoverTapSlop kHoverTapTimeout kJumpTapTimeout
@sergey-shpak
sergey-shpak / hyperapp.js
Created October 9, 2018 00:08
Hyperapp DOM Observer Subscription (MutationObserver) Implementation
import { app, h } from 'hyperapp'; // V2
// DOM Effect
// Observer Implementation
// Will be moved to subscriptions package
const find = (query, nodes, cb) => nodes.forEach(node => {
if(node.nodeType !== 1 ) return
if(Object.keys(query).every(key => node.getAttribute(key) === query[key]))
return cb(node)
else if(node.childNodes.length)
@pesterhazy
pesterhazy / clj_to_js.md
Last active February 26, 2024 20:18
ClojureScript Do's and Don'ts: clj->js

ClojureScript Do's and Dont's: clj->js

You should prefer

#js["tag" #js{"k1" v1, "k2" v2}]

over

@davidpiesse
davidpiesse / tailwind_md_all_colours.js
Last active February 8, 2024 09:31
A colour set for Tailwind CSS that include all Material Design Colours, shades, accents and contrast colours
// https://davidpiesse.github.io/tailwind-md-colours/
//
//Notes
//
//All colours are generated from Material Design Docs
//Colours have a base, a set of shades (50-900) accent colours
//In addition a companion set of contrast colours are included for colouring text / icons
// Example usage
// class="w-full bg-red-600 text-red-600-constrast"
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active March 28, 2024 09:37
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub