Skip to content

Instantly share code, notes, and snippets.

Avatar

A. Matías Quezada amatiasq

View GitHub Profile
View concatRegexes.js
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("");
View typed-messaging.ts
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'];
View cached-request.js
let cache = null;
export function myCachedRequest() {
if (cache) {
return Promise.resolve(cache);
}
return fetch('potato.com/foo').then(x => {
cache = x;
return x
View add-time-parameter.js
let url = '';
a
.split('\n')
.map(x => {
if (!x) {
return x;
}
if (x.startsWith('- [Lesson ')) {
View Clean Code - Masterclass.md

Lesson 1 - Clean Code

  • 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 Aug 21, 2020
Signers of Software Craftmanshift Manifesto (so far)
View softwarecraftsmanship.json
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"
},
View 3d-photo-inpaiting.sh
#!/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
View collision.fs
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
composable cell
View index.html
<!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 Apr 19, 2020
Created with Fable REPL
View fable-repl.css
html, body {
margin: 0;
padding: 0;
background-color: black;
}