What does new Array(x)
do? Trick question. It does different things depending on whether x
is an integer or something else.
I wanted to replicate this elegant functionality in Haskell: behold.
// ETL pipeline | |
sig DataSource {} | |
sig Step { | |
requires: set Step | |
} | |
sig Database, File extends DataSource {} | |
sig Extract in Step { |
#!/bin/bash | |
# SPDX-License-Identifier: MIT | |
# SPDX-FileCopyrightText: 2018 Ben Siraphob <bensiraphob@gmail.com> | |
command -v gshuf >/dev/null 2>&1 || { echo >&2 "gshuf is required but is not installed. Run \"brew install coreutils\"."; control_c; } | |
command -v spoof-mac >/dev/null 2>&1 || { echo >&2 "spoof-mac is required but is not installed. Run \"brew install spoof-mac\"."; control_c; } | |
# Colors | |
RED='\033[0;31m' | |
NC='\033[0m' |
# Python 3 | |
import collections | |
Write = collections.namedtuple("Write", ["written"]) | |
def hello_world(): | |
yield Write("Hello, world!") | |
yield Write("Hello, world!") | |
return 1 | |
def identity(gen): |
A short exact sequence is a sequence of maps: | |
f g h k | |
0 --> A --> B --> C --> 0 | |
s.t. | |
Im f = Ker g | |
Im g = Ker h | |
Im h = Ker k | |
Example: |
Require Import Coq.NArith.NArith. | |
Require Import Coq.Arith.Arith. | |
Require Import Coq.Lists.List. | |
Require Import Coq.Logic.Eqdep_dec. | |
Definition decidable (P: Prop) := {P} + {~P}. | |
Definition eq_dec T := forall (x y:T), decidable (x=y). | |
Inductive spec_type: Set := | |
| abruption |
#!/usr/bin/env nix-shell | |
#!nix-shell -i python -p "python3.withPackages(ps: with ps; [ i3ipc ])" | |
# A script I've thrown together | |
# to use my tablet as a somewhat usable extra screen. | |
# The core idea is to ssh (mosh) to my work laptop, | |
# attach to a tmux session creating a new group (`tmux new-session -t tablet`) | |
# and then create a tmux binding to exchange windows between tablet and laptop | |
# (`bind Tab swap-window -t tablet`). |
apps/ |
# Likes per tweet plot | |
# Analyze user's data downloaded from Twitter | |
library(jsonlite) | |
library(tidyverse) | |
# download your data from Twitter (Settings and Privacy, Your Twitter data), unzip the folder | |
setwd("~/Downloads/twitter-2018-10-29-6c18f5c0ab3605451f73cd0fd9ed186a2fd5b2caf1812ab747d42351da805656/") | |
json <- readLines("tweet.js") |
Supporting examples 90 words (9 examples @ 10 words each) | |
Elevator pitch 50 words | |
Positioning statement 35 words | |
Headline benefits 24 words (3 benefits @ 8 words each) | |
Mission statement 20 words | |
Brand pillars 15 words (3 pillars @ 5 words each) | |
Target audience 15 words | |
Brand promise 10 words |