Skip to content

Instantly share code, notes, and snippets.

View alexdunae's full-sized avatar

Alex Dunae alexdunae

View GitHub Profile
@alexdunae
alexdunae / wordpress_custom_post_gallery.php
Created March 31, 2011 23:55
Display a custom post type's media library inline on the WordPress edit page screen
<?php
define('MY_POST_TYPE', 'my');
define('MY_POST_SLUG', 'gallery');
function my_register_post_type () {
$args = array (
'label' => 'Gallery',
'supports' => array( 'title', 'excerpt' ),
'register_meta_box_cb' => 'my_meta_box_cb',
@alexdunae
alexdunae / fb-gallery-embed.html
Created September 24, 2011 17:05
Embedded Facebook Page Photo Gallery with jQuery
31658bad48a1e6882c4b6a7e6b8d82be@example.com
95e9ea69b69fe64bbf4b9d3f12bd976e@example.com
6a16beb4c341de45352dc28edf3c65f2@example.com
2802d5ebd8ee9398741b9be44f58111c@example.com
eec4a102023e0b994a96f51c82dbefb8@example.com
3741b79946265b4efca7a516f71f5c7b@example.com
3ef9ee323e51c2265e74a30d73b16b3a@example.com
922ac33cb02f0836fa8a90ca7a0c7d0b@example.com
83e93ecc72be424078564c77b4c1555e@example.com
3c785b34c06d62b312e6a08739cd6f5d@example.com
b46202ef5b16076fddcb3ea6dec33e7a@example.com
6b539f68dd51778626e63b640427f5cd@example.com
07afa1777af8f602b6385659135cc455@example.com
dd59527c1cd2b540ff561d5669095f49@example.com
c47dd25ece6210c7c36c676d1e6a05a6@example.com
151109cec2a0c11cfe24d250ea8543ff@example.com
7322500a1849101a51424c47e642fa00@example.com
0f05a54ff760734a365633b30518c351@example.com
2f11fbef0db322edaad9427e6a27c0cc@example.com
f5e0a13eb0562d01511160875227ca80@example.com
@alexdunae
alexdunae / day01.cr
Last active December 2, 2021 19:51
Advent of Code 2021 Ruby vs Crystal
file = "input.txt"
increases = 0
last_window = nil
a = nil
b = nil
c = nil
File.each_line(file) do |measurement|
@alexdunae
alexdunae / README.md
Last active September 21, 2021 01:58

BC COVID-19 Vaccine Passport

BC's COVID-19 vaccine passport is encoded as a JSON web token following the SMART Health Card open spec.

I made a little write up about how to decode the data.

Vax codes

You can inspect the http://snomed.info/sct coding key to see which type of vaccines were recorded:

@alexdunae
alexdunae / Gemfile
Last active April 19, 2019 06:55
Guard + sass + autoprefixer
source 'https://rubygems.org/'
gem 'guard'
gem 'guard-sass', git: 'git@github.com:alexdunae/guard-sass.git'
gem 'autoprefixer-rails'
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
const EventSalesReport = props => {
const [open, setOpen] = useState(false);
const [count, setCount] = useState(0);
console.log(`render: open is ${open}`);
const handleDocumentClick = function(event) {
@alexdunae
alexdunae / ReactNativeJson.java
Last active May 13, 2018 18:04 — forked from viperwarp/ReactNativeJson.java
React-Native Module, ReadableMap/Array to Java JSON objects
public static WritableMap convertJsonToMap(JSONObject jsonObject) throws JSONException {
WritableMap map = new WritableNativeMap();
Iterator<String> iterator = jsonObject.keys();
while (iterator.hasNext()) {
String key = iterator.next();
Object value = jsonObject.get(key);
if (value instanceof JSONObject) {
map.putMap(key, convertJsonToMap((JSONObject) value));
} else if (value instanceof JSONArray) {
<?php
add_action( 'rest_api_init', function () {
register_rest_route( 'salmon/v1', '/salmonnames', array(
'methods' => 'GET',
'callback' => 'get_salmon_names',
) );
} );