Skip to content

Instantly share code, notes, and snippets.

Avatar
🐇

Christopher Blanchard cblanc

🐇
View GitHub Profile
@Burnsy
Burnsy / .meshrc.yaml
Last active Apr 6, 2021
GraphQL Mesh Implementation of ideal-postcodes.co.uk
View .meshrc.yaml
sources:
- name: idealPostcodes
handler:
openapi:
source: https://openapi.ideal-postcodes.dev/openapi.yaml
baseUrl: https://api.ideal-postcodes.co.uk/v1/
operationHeaders:
Authorization: IDEALPOSTCODES api_key="XXXXXXX"
serve:
port: 8912
@heyMP
heyMP / utils.js
Last active Aug 3, 2021
Recursively find elements through multiple layers of shadow dom.
View utils.js
/**
* Example usage:
* const hotspots = findAllDeep(this.shadowRoot.querySelector('slot'), `[slot*="hotspot"]`, 1);
*/
export const findAllDeep = (parent, selectors, depth = null) => {
let nodes = [];
let currentDepth = 1;
const recursiveSeek = _parent => {
// record the nodes
for (let child of _parent.assignedNodes({ flatten: true })) {
@andy-thomason
andy-thomason / Genomics_A_Programmers_Guide.md
Created May 14, 2019
Genomics a programmers introduction
View Genomics_A_Programmers_Guide.md

Genomics - A programmer's guide.

Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.

https://www.genomicsplc.com

View naturalSort.filter.js
angular
.module( "core.common.internationalization" )
.constant( "naturalSort", naturalSort )
.constant( "naturalSortComparator", naturalSortComparator );
// Comparator to be used with the orderBy filter
function naturalSortComparator( a, b ) {
return naturalSort( a.value, b.value );
}
@rbq
rbq / docker.yaml
Last active Nov 14, 2021
Install Docker CE on Ubuntu using Ansible
View docker.yaml
---
- hosts: all
tasks:
- name: Install prerequisites for Docker repository
apt:
name: ['apt-transport-https', 'ca-certificates', 'curl', 'gnupg2', 'software-properties-common']
update_cache: yes
- name: Add Docker GPG key
apt_key:
@webframp
webframp / keybase.md
Created Jul 25, 2017
Signing git commits on github using keybase.io gpg key
View keybase.md

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@kyranjamie
kyranjamie / countries.enum.ts
Last active Nov 24, 2021
TypeScript enum Country Codes ISO 3166
View countries.enum.ts
export enum Country {
Afghanistan = 'AF',
AlandIslands = 'AX',
Albania = 'AL',
Algeria = 'DZ',
AmericanSamoa = 'AS',
Andorra = 'AD',
Angola = 'AO',
Anguilla = 'AI',
Antarctica = 'AQ',
@iloveitaly
iloveitaly / capybara_fill_stripe_elements.rb
Created Mar 4, 2017
Fill in a Stripe Elements (https://stripe.com/docs/elements) credit card field using capybara
View capybara_fill_stripe_elements.rb
def fill_stripe_elements(card)
using_wait_time(15) { within_frame('stripeField_card_element0') do
card.to_s.chars.each do |piece|
find_field('cardnumber').send_keys(piece)
end
find_field('exp-date').send_keys("0122")
find_field('cvc').send_keys '123'
find_field('postal').send_keys '19335'
end }
@jarbro
jarbro / dnsme2048dkim.md
Last active Feb 12, 2020
DNS Made Easy 2048 bit DKIM Support
View dnsme2048dkim.md

DNS Made Easy 2048 bit DKIM support

If you have ever attempted to create your own DKIM key for your own mail server you know it can be a daunting task. Every flavor SMTP DKIM configuration is a bit different. Though once you've gotten your SMTP server configured with your private and public key, the easiest part of the entire process should be to make the necessary changes at your DNS provider,right? Unfortunately, not all providers support automatically accepting 2048 bit DKIM keys and you are ready to bang your head against the wall. Why dont they support a 2048 bit key or larger? Well, their system wont automatically handle keys larger than 255 contiguous characters because they haven't updated their interfaces to handle RFC 4408. More on this in a bit.

If you are using DNS Made Easy like I was, you probably ran across the error when trying to enter your DKIM key.

"Contiguous strings may not be longer than 255 characters"

Thankfully, [DNS RFC 4408](https