Skip to content

Instantly share code, notes, and snippets.

View DamianMullins's full-sized avatar
💭
👽

Damian Mullins DamianMullins

💭
👽
View GitHub Profile
@DamianMullins
DamianMullins / multi-polygon-point.py
Last active October 6, 2023 09:46
Plot markers randomly within polygon bounds
from shapely.geometry import MultiPolygon, Polygon, Point
import random
bounds = [
[
[
[-4.99824542549959, 58.23898617250778],
[-5.007466916919611, 58.25489633232511],
[-5.020842902073355, 58.25760913297689],
[-5.0256317836867765, 58.25020107636015],

Keybase proof

I hereby claim:

  • I am damianmullins on github.
  • I am damianmullins (https://keybase.io/damianmullins) on keybase.
  • I have a public key ASC6zDg_UljC3qpSlbCIinS0pPhz3usefcIKX5UJEgSSOgo

To claim this, I am signing this object:

@DamianMullins
DamianMullins / clean-duplicates.js
Last active January 5, 2023 14:40
Clean MongoDB nested array duplicated records
const assert = require('assert');
const { MongoClient } = require('mongodb');
MongoClient.connect('mongodb://127.0.0.1:27017/', (err, client) => {
assert.equal(null, err);
console.log('Connected correctly to server\n');
async function run(arrayName) {
const database = client.db('data-integrator');
const orders = database.collection('orders');
@DamianMullins
DamianMullins / input.scss
Created August 19, 2022 14:08
Generated by SassMeister.com.
@use "sass:map";
$spacing: (
a : 4px,
b : 8px,
c : 12px,
// d : 16px,
// e : 24px,
// f : 32px,
// g : 40px,
<template>
<fieldset>
<legend>{{ $t('menu.chooseOne') }}</legend>
...
</fieldset>
</template>
<template>
<div>
<h4>{{ $t('menu.chooseOne') }}</h4>
...
</div>
</template>
<template functional>
<div>
<input
:id="props.labelId"
type="radio"
:checked="props.isSelected"
:name="props.groupName"
:value="props.value"
@change="listeners.radioChanged"> <!-- Change event -->
<template functional>
<div>
<input
:id="props.labelId"
type="radio"
:checked="props.isSelected"
:name="props.groupName"
:value="props.value">
<label
@DamianMullins
DamianMullins / damianmullins.com.gatsby.v1.json
Last active December 12, 2018 13:57
damianmullins.com performance profiles before and after Gatsby upgrade to v2.
This file has been truncated, but you can view the full file.
[{"pid":7501,"tid":11779,"ts":141103209341,"ph":"X","cat":"toplevel","name":"MessagePumpLibevent::OnLibeventNotification","args":{"src_file":"../../mojo/core/channel_posix.cc","src_func":"StartOnIOThread"},"dur":42,"tdur":41,"tts":3631223343},
{"pid":7501,"tid":11779,"ts":141103209389,"ph":"X","cat":"toplevel","name":"MessagePumpLibevent::OnLibeventNotification","args":{"src_file":"../../mojo/core/channel_posix.cc","src_func":"StartOnIOThread"},"dur":24,"tdur":23,"tts":3631223391},
{"pid":7501,"tid":11779,"ts":141103209420,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../mojo/public/cpp/system/simple_watcher.cc","src_func":"Notify"},"dur":12,"tdur":11,"tts":3631223421},
{"pid":7501,"tid":11779,"ts":141103209439,"ph":"X","cat":"toplevel","name":"MessagePumpLibevent::OnLibeventNotification","args":{"src_file":"../../mojo/core/channel_posix.cc","src_func":"StartOnIOThread"},"dur":17,"tdur":17,"tts":3631223440},
{"pid":7501,"tid":11779,"ts":141103209464,"ph":"X","cat":"toplevel","
<!DOCTYPE html>
<html>
<head>
<title>Vanilla Redux</title>
<script src="https://unpkg.com/redux@latest/dist/redux.min.js"></script>
</head>
<body>
<p>