Skip to content

Instantly share code, notes, and snippets.

View damncabbage's full-sized avatar
🙅‍♀️
permanent omnishambles

Robin Howard damncabbage

🙅‍♀️
permanent omnishambles
View GitHub Profile
@damncabbage
damncabbage / README.md
Last active September 15, 2020 13:40 — forked from BinaryMuse/README.md
Change your profile photo for all meetup groups

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 November 2, 2019 15:40
Voyager Image, Ruby port
source 'https://rubygems.org'
gem 'wavefile'
@damncabbage
damncabbage / Cargo.toml
Last active October 28, 2019 04:59
Voyager Image, a crappy non-functional attempt. 😅
[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 September 16, 2019 13:23
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.
// @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();
//

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:

import sys
from time import sleep
import random
import cursor
class Renderer:
def __init__(self, width, height):

(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”

PSA about Git in case folks haven't run into git push --force-with-lease before: it just saved my bacon (again).

I have a shared branch for a feature my team at work is working on, feature/flub [yes, okay, I've anonymised it]. We've been merging PRs into it.

To incorporate the build-fix changes above, I did this:

$ git checkout feature/flub                # I've been working on other stuff; let's hop over to the shared branch.
$ git pull --rebase origin master          # Take the branch, and pretend we *just* created it off the latest 'master' on GitHub.
$ git push --force-with-lease origin HEAD  # Tell GitHub about the new change.
To github.com:myorg/thing.git
@damncabbage
damncabbage / Code.gs
Last active February 25, 2019 08:09
Google Calendar Crappy Day Planner, Calendar Import Script
function importCalendar(){
// Settings, because who needs function arguments?
// --------------
var calendarName = 'my.name@companydomain.com';
var day = new Date();
var firstHour = 8;
var lastHour = 18;
var canonicalStartRow = 2;
var canonicalColumn = 2;
var templateSheetName = 'Template';