Skip to content

Instantly share code, notes, and snippets.

Avatar
🙅‍♀️
permanent omnishambles

Rob Howard damncabbage

🙅‍♀️
permanent omnishambles
View GitHub Profile
View csv_stream.php
<?php
class CSVStream {
/**
* List of available source fields.
*
* @var array
*/
protected $fields = array();
View elm-typescript-types-comparison.md

(This is a fork of Michael's original gist with some editing of the unions + records sections.)

Elm and Typescript: comparison of type checking features

Each of these examples assume the usage of --strict mode in Typescript

Enums

Elm

Can be implemented using “Custom Types”

@damncabbage
damncabbage / README.md
Last active Sep 15, 2020 — forked from BinaryMuse/README.md
Change your profile photo for all meetup groups
View README.md

I haven't found a way to set your main profile photo on meetup.com such that it overrides any old photos you have set in individual groups. This script will do just that — set your group specific profile photo to your main photo for every group you're in.

Here's what to do:

  1. Go to your main profile page: http://www.meetup.com/profile/
  2. Ensure you've set your main profile photo to the photo you want to use in all your groups.
  3. Open your browser's developer tools (often F12 on Windows, cmd+opt+i on macOS), copy the following code, paste it in the Console tab, and press enter:
var memberId = 56746842; // <=== Edit this
@damncabbage
damncabbage / Gemfile
Created Nov 2, 2019
Voyager Image, Ruby port
View Gemfile
source 'https://rubygems.org'
gem 'wavefile'
@damncabbage
damncabbage / Cargo.toml
Last active Oct 28, 2019
Voyager Image, a crappy non-functional attempt. 😅
View Cargo.toml
[package]
name = "voyager_images"
version = "0.1.0"
authors = ["Rob Howard <rob@robhoward.id.au>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
hound = "3.4.0"
@damncabbage
damncabbage / useUnmountCanary.js
Created Sep 16, 2019
A hook that provides a flag to be used in promises and other async functions that can be triggered and not yet resolved by the time a component unmounts.
View useUnmountCanary.js
// @flow
import { useEffect, useRef } from 'react';
// A hook that provides a flag to be used in promises and other async functions that
// can be triggered and not yet resolved by the time a component unmounts.
//
// For example:
//
// const isMounted = useUnmountCanary();
//
View chat - explaining_ruby_yield.markdown

Yields control back to the context that resumed the fiber ah yeah totally :thinking_very_much: ... anyone have an english explanation of ruby yield I never get it. Also yield_self and the difference please, thanks.

There's unfortunately a few things going on; there's regular Ruby yield keyword, there's yield_self method on everything, and there's the Fiber version of yield that has nothing to do with either (which basically nobody is going to need to know about, including me).

Which did you want to know about? 'Regular' yield?


Just in case this helps:

View punch_tape_animation.py
import sys
from time import sleep
import random
import cursor
class Renderer:
def __init__(self, width, height):
@damncabbage
damncabbage / gist:2841319
Last active Jun 6, 2019
Squiz Coding Standard
View gist:2841319
$abc.=.Array(
# # 'foo'# # =>.1,
# # 'longline'# =>.2,
# # 'bar'# # =>.3,
# # 'yolo'# # =>.Array(
# # # # # # 'foo'# =>.4,
# # # # # # 'bar'# =>.5,
# # # # # ...),
# ...);