Skip to content

Instantly share code, notes, and snippets.

View stefee's full-sized avatar

Stef stefee

View GitHub Profile
import { Fetcher, FetchResponseError } from "./Fetcher";
function createMockResponse({
ok = true,
json = async () => ({ foo: "bar" }),
status = 200,
url = "/example",
}: Partial<Response> = {}) {
return {
ok,
class MultipleRejectError extends Error {
constructor(message, errors) {
super(message);
Error.captureStackTrace(this, MultipleRejectError);
this.errors = errors.map(error =>
Object.defineProperty(error, 'message', { value: error.message, enumerable: true })
);
}
}
/*
- Int to English -
The hope is that we can input any signed 32-bit
integer and output a string that is that integer
in plain English.
The regular expressions for s32 int ranges in
plain English are as follows:
[package]
name = "stretch-issue-repro"
version = "0.1.0"
edition = "2018"
[dependencies]
stretch = "0.3.2"

Here is an example of a CircleCI workflow:

workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build
      - setup_deploy_workspace:
 filters:
@stefee
stefee / videojs-scalable.css
Created October 12, 2017 19:34
.video-js.vjs-scalable - Makes video.js scalable, retaining 16:9 aspect ratio.
.video-js.vjs-scalable {
width: 100%;
height: auto;
}
.video-js.vjs-scalable .vjs-tech {
top: 0; right: 0; bottom: 0; left: 0;
position: absolute;
}
.video-js.vjs-scalable::before {
content: "";
@stefee
stefee / atom-add-project
Created September 6, 2017 17:09
Add the current directory to ~/.atom/projects.cson
#!/bin/sh
set -e
CURRENT_DIR=$PWD
ATOM_DIR="$HOME/.atom"
if ! [ -f $ATOM_DIR -o -L $ATOM_DIR ]; then
echo "Exiting: $ATOM_DIR does not exist"
exit 1
@stefee
stefee / conf_backup.sh
Last active September 6, 2017 13:32
DEPRECATED in favour of https://github.com/srilq/dotfiles
#!/bin/bash
ERRORS=$((0))
USER_ROOT="/Users/sril"
BAK_ROOT="$USER_ROOT/Google Drive/Archive/conf"
DATESTRING=$(date +%d.%m.%y)
if [ ! -d "$BAK_ROOT" ]; then
echo "ERROR: backup root folder does not exist, $BAK_ROOT"
ERRORS=$((ERRORS+1))
@stefee
stefee / GroupUtility.cs
Created June 27, 2017 17:41
Simple Group Utility for Unity3D - made by Ryan Miller ryan@reptoidgames.com
using UnityEngine;
using System.Collections;
using UnityEditor;
using System;
///
/// Simple Group Utility for Unity3D - made by Ryan Miller ryan@reptoidgames.com
///
[ExecuteInEditMode]
public class GroupUtility : Editor {