Skip to content

Instantly share code, notes, and snippets.

View magicmark's full-sized avatar
🇬🇧

Mark Larah magicmark

🇬🇧
View GitHub Profile
@magicmark
magicmark / AlertBox.swift
Last active August 29, 2015 14:22
AlertBox - Abstract the creation of Alert Boxes for iOS, to allow for the creation of alert boxes using iOS 7 API methods and iOS 8 methods as appropriate
//
// AlertBox.swift
// magicmark
//
// Created by Mark Larah on 31/05/2015.
// Copyright (c) 2015 Mark. All rights reserved.
//
// Handles both iOS7 and iOS8 Alert Styles
@magicmark
magicmark / DynamicScrollViewContainer.swift
Last active August 29, 2015 14:23
Allow dynamic UIScrollView content view sizes to work with AutoLayout
//
// DynamicScrollViewContainer.swift
// magicmark
//
// Created by Mark Larah on 25/05/2015.
// Copyright (c) 2015 Mark. All rights reserved.
//
import UIKit
@magicmark
magicmark / index.jsx
Last active April 5, 2017 14:13
Bare Bones React
import React from 'react';
import ReactDOM from 'react-dom';
import Sheep from './sheep';
ReactDOM.render(<Sheep />, document.getElementById('root'));
@magicmark
magicmark / keybase.md
Last active September 8, 2019 04:23
keybase.md

Keybase proof

I hereby claim:

  • I am magicmark on github.
  • I am mark_larah (https://keybase.io/mark_larah) on keybase.
  • I have a public key whose fingerprint is D02E 6A72 0CD8 8AC4 65CF 14AB 1640 AC3E 8DCF 8CE7

To claim this, I am signing this object:

getUserInfo({
user_ids: Array<number>,
locale: string,
include_private_info: ?boolean
}) => Promise<Array<UserInfo>>
@magicmark
magicmark / cf-merge
Created February 14, 2020 10:29
Tool to import CloudFormation yaml sections
#!/usr/bin/env node
const { existsSync, readFileSync } = require("fs");
const path = require('path');
const APP = "cf-merge";
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html
const TOP_LEVEL_TOKENS = [
"AWSTemplateFormatVersion",
"Description",
"Metadata",
@magicmark
magicmark / generate-schema.js
Created July 21, 2020 23:11
Generate a dummy graphql schema
/**
* @file Helper tool to generate a huge schema for testing purposes
*
* Usage:
*
* $ ./generate-schema <numberOfTypes> <fieldsPerType>
*/
const assert = require("assert");
export type SchemaCoordinate = {|
+kind: 'SchemaCoordinate',
+coordinate: CoordinateNode,
|};
export type CoordinateNode =
| EnumNode
| ObjectNode
| InputObjectNode
| InterfaceNode;
@magicmark
magicmark / test.js
Created March 8, 2021 07:07
Testing the node cluster module
const util = require("util");
const exec = util.promisify(require("child_process").exec);
const SERVER = "localhost:8000";
async function sendRequest() {
let result;
const startAt = process.hrtime();
https://github.com/DanielMSchmidt/apollo-opentracing/pull/574
This patch contains the diff in the above PR - to let apollo-opentracing support @apollo/server v4
----------
diff --git a/node_modules/apollo-opentracing/dist/context.d.ts b/node_modules/apollo-opentracing/dist/context.d.ts
index 2835f6b..defa9ac 100644
--- a/node_modules/apollo-opentracing/dist/context.d.ts
+++ b/node_modules/apollo-opentracing/dist/context.d.ts