Skip to content

Instantly share code, notes, and snippets.

View hdbham's full-sized avatar
🇱🇷
Volunteering

Hunter Burningham hdbham

🇱🇷
Volunteering
View GitHub Profile
@magician11
magician11 / robots.txt.njk
Created September 10, 2023 20:33
sitemap.xml and robots.txt for 11ty (Eleventy)
---
eleventyExcludeFromCollections: true
eleventyComputed:
permalink: "{{ site.robots }}"
---
Sitemap: {{ site.baseUrl + site.siteMap }}
User-agent: *
Disallow:
@Ustice
Ustice / Boolean Algebra for Programmers in a Nutshell.md
Last active January 9, 2024 20:16
Boolean Algebra in a nutshell for JS/TS programmers

Boolean Algebra in a nutshell for JS/TS programmers

There are a lot of strategies that you will hear about in the Javascript community for keeping your conditionals from becoming a tangled mess. This isn't like them. This is someting different. MATH! Boolean Algebra to be exact. I use it all the time to simplify complex conditionals. There are two things that you need to know: de Morgan's Theorem, and Karnaugh (pronounced CAR-no) Maps. (Don't worry, there is no test)

de Morgan's Theorem

De Morgan's Theorem is great distributing nots (!), and for when you want to convert an && to an ||, or back. This is it:

 !(A && B) = !A || !B
@ryan-jr
ryan-jr / lessonsLearned.md
Last active March 13, 2024 02:26
Based around the idea of the missing semester, meant to provide useful information for recent grads.

Useful Things to Know and Where to Find Them

This is loosely based around MIT's idea of the missing CS Semester: https://missing.csail.mit.edu/ as well as the Stanford Problem Solving for the CS Technical Interview https://web.stanford.edu/class/cs9/ and here you'll find links to things that I've found useful in my job search over the last month or so.

Need to Know

General

#!/bin/bash
# rename TMS tiles to the XYZ schema
# no quoting, since all files have simple numeric names
# do not run this anywhere else than INSIDE your tiles directory
# run it like this: find . -name "*.png" -exec ./tms2xyz.sh {} \;
filename=$1
tmp=${filename#*/} # remove to first /