Skip to content

Instantly share code, notes, and snippets.

@DavidBuchanan314
DavidBuchanan314 / NWSL.TXT
Last active September 1, 2023 14:11
I think this is functionally MIT-equivalent but I am not a lawyer!
NUCLEAR WASTE SOFTWARE LICENSE V1.0
Copyright <YEAR> <OWNER>
This software license is a message... and part of a system of messages...
pay attention to it! Writing this software and associated documentation
files (the "Software") was important to us. We considered ourselves to be a
powerful culture. This Software is not a place of honor... no highly
esteemed deed is commemorated here... nothing valued is here. What is here was
dangerous and repulsive to us. This message is a warning about danger. The
@coolreader18
coolreader18 / segfault.py
Last active March 30, 2024 08:05
CPython segfault in 5 lines of code
class E(BaseException):
def __new__(cls, *args, **kwargs):
return cls
def a(): yield
a().throw(E)
@dmorosinotto
dmorosinotto / TestTypedForms.ts
Last active July 7, 2023 05:09
Typed @angular/forms FIXED set/patchValue - strict all the way down ^_^
import { FormGroup, FormControl, FormArray, Validators } from "@angular/forms";
function testFormGroupTyped() {
var frm = new FormGroup({
a: new FormArray([new FormControl(0)]),
b: new FormControl(true),
c: new FormGroup({
s: new FormControl("abc"),
n: new FormControl(123)
})
@morewry
morewry / _debug-map.scss
Created March 13, 2014 06:21
Sass print-map function and mixin for quick debugging of maps
/*
# Print Map
Usage:
// option 1
.debug {
@include print-map($map);
}
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 7, 2024 09:29
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@prwhite
prwhite / Makefile
Last active May 2, 2024 18:02
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@badsyntax
badsyntax / find-unused-sass-variables.sh
Last active November 24, 2021 09:59 — forked from axelerator/Find unused variables in sass files
Find unused SCSS variables. Usage: `./find-unused-sass-variables.sh sassDir/`
#!/usr/bin/env bash
#
# Approach:
# 1. Find variable declaration in the form of "$my-var: anyvalue"
# 2. Loop through found variables and find occurrences of each variable in all sass files
# 3. Filter out vars that occurred only once
if [ -z "$1" ]; then
echo "Please specify a directory as the first argument."
exit 1
@worthlesscog
worthlesscog / gist:3060273
Created July 6, 2012 13:53
Polymorphic JSON unmarshall with Jackson in Scala
import org.codehaus.jackson.annotate.{ JsonTypeInfo, JsonSubTypes, JsonProperty }
import org.codehaus.jackson.annotate.JsonSubTypes.Type
import org.codehaus.jackson.map.ObjectMapper
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes(Array(
new Type(value = classOf[Bingo], name = "x"),
new Type(value = classOf[Bongo], name = "y"),
new Type(value = classOf[Bungo], name = "z")
))