Skip to content

Instantly share code, notes, and snippets.

View sallar's full-sized avatar
:shipit:
Staring into an abyss

Sallar sallar

:shipit:
Staring into an abyss
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<input type="password" name="password">
@sallar
sallar / example.ts
Last active August 13, 2023 01:08
TypeScript Either / Pattern Matching
import { Either, Left, Right, match } from './patterns.ts';
interface Person {
name: string;
}
const readValueFromAPI = (): Either<Error, Person> => {
// ...
const person: Person = {
name: 'Test',
@sallar
sallar / console-example.php
Created March 27, 2013 19:44
PHP Colored CLI Output Script.
<?php
// Output screenshot:
// http://cl.ly/NsqF
// -------------------------------------------------------
include_once 'console.php';
// ::log method usage
// -------------------------------------------------------
Console::log('Im Red!', 'red');