Skip to content

Instantly share code, notes, and snippets.

View amatiasq's full-sized avatar

A. Matías Quezada amatiasq

View GitHub Profile
@amatiasq
amatiasq / concatRegexes.js
Last active February 24, 2021 08:57
concatRegexes
const createConcatenator = escape => (...regexes) => {
const join = regexes
.map(x => (x instanceof RegExp ? regexToString(x) : escape(x)))
.join("");
const flags = regexes
.map(x => x instanceof RegExp && x.flags)
.filter(Boolean)
.join("");
interface Message<Type extends string | number, Data = never> {
type: Type;
data: Data;
}
type MessageData<
Msg extends Message<any, any>,
Type extends Msg['type']
> = Extract<Msg, { type: Type }>['data'];
let cache = null;
export function myCachedRequest() {
if (cache) {
return Promise.resolve(cache);
}
return fetch('potato.com/foo').then(x => {
cache = x;
return x
let url = '';
a
.split('\n')
.map(x => {
if (!x) {
return x;
}
if (x.startsWith('- [Lesson ')) {
  • 0:00 Event Presentation
  • 2:03 Presenter Introduces Uncle Bob
  • 3:41 Uncle Bob Introduction / My Tribe
  • 4:49 How Far is the Sun?
  • 10:52 Introduction to Clean Code
  • 12:21 The current Society works with Software
  • 19:47 Volkswagen case / Introduction to the Ethics of Software Development
  • 24:28 Why are Programmers so slow?
  • 32:13 What is a Clean Code?
@amatiasq
amatiasq / softwarecraftsmanship.json
Created August 21, 2020 15:41
Signers of Software Craftmanshift Manifesto (so far)
This file has been truncated, but you can view the full file.
[
{
"name": "Doug Bradbury",
"location": "Chicago, IL, USA"
},
{
"name": "Corey Haines",
"location": "Cleveland, OH"
},
{
#!/bin/bash
# Clone repo
sudo apt install git
git clone https://github.com/ayulockin/3d-photo-inpainting.git
# Install python 3.7
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
let screen = Vector(800., 600.)
let ball = Circle 10.
let box = Rectangle screen
let collision = detectCollision ball box
match collision with
| NoCollision -> ...
| Collision FullContact -> x
| Collision (PartialCollision side) -> x
@amatiasq
amatiasq / index.html
Created May 11, 2020 21:22
composable cell
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script type="module" src="run.js"></script>
<style>
html,
body,
@amatiasq
amatiasq / fable-repl.css
Created April 19, 2020 23:27
Created with Fable REPL
html, body {
margin: 0;
padding: 0;
background-color: black;
}