Skip to content

Instantly share code, notes, and snippets.

View jorisvddonk's full-sized avatar

Joris van de Donk jorisvddonk

View GitHub Profile
@jorisvddonk
jorisvddonk / Dockerfile
Created April 1, 2023 19:28
Two-liner to install CMake 3.26.2 to /opt in Docker
RUN mkdir -p /opt/bin; mkdir -p /opt/doc; mkdir -p /opt/man; mkdir -p /opt/share; wget -O - https://github.com/Kitware/CMake/releases/download/v3.26.2/cmake-3.26.2-linux-x86_64.tar.gz | tar -xvzf - -C /opt --strip-components=1
ENV PATH=/opt/bin:${PATH}
RUN cmake --version
@jorisvddonk
jorisvddonk / ApolloComplexityPlugin.ts
Last active October 9, 2022 23:01
ApolloComplexityPlugin
import { ApolloServerPlugin, GraphQLServiceContext } from "apollo-server-plugin-base";
import { GraphQLSchema, separateOperations } from "graphql";
import { fieldConfigEstimator, getComplexity, simpleEstimator } from "graphql-query-complexity";
export class ApolloComplexityPlugin implements ApolloServerPlugin {
private schema: GraphQLSchema;
constructor(private maxComplexity: number) { }
public serverWillStart(service: GraphQLServiceContext) {
@jorisvddonk
jorisvddonk / README.md
Last active January 18, 2017 08:14
Utomik Game browser - JSONETTE app

This is a very basic Utomik game browser for your smartphone! It's built using Jasonette. I spent about 30 minutes on it from the moment I heard about Jasonette.

How to use

  1. Install Jason, the jsonette viewer on your iOS/Android phone. NOTE: For Android, you might want to install this more up to date version of the viewer instead.
  2. Open Jason
  3. In Jason, where it says 'enter a valid jason url', enter the raw URL to the .json file in this gist, then hit 'Go'.
  4. Tap on 'Utomik game browser' and SEE GAMES. Wow. Such amaze.
@jorisvddonk
jorisvddonk / index.html
Last active January 31, 2018 12:36
Utomik Rad van Fortuin (MOVED TO GITLAB & SURGE.SH)
<html>
<head>
<meta http-equiv="refresh" content="0;URL='http://utomik-wheel-of-fortune.surge.sh'">
<script type="text/javascript">
window.location.href='http://utomik-wheel-of-fortune.surge.sh';
</script>
</head>
<body>
Hello, this page has moved to <a href="http://utomik-wheel-of-fortune.surge.sh">http://utomik-wheel-of-fortune.surge.sh</a>.
</body>
@jorisvddonk
jorisvddonk / sci_fi_recommended_reading.md
Last active January 27, 2020 21:28
Some sci-fi readables I enjoyed
@jorisvddonk
jorisvddonk / gist:e7e2d0bab78ec1e22634
Created April 28, 2015 16:42
Example custom operators for Mingo
/*
$pluck is a pipeline operator which returns the result of resolving `expr` on each item in the collection.
This allows you to 'boil down' a collection to just the values you're interested in.
Example:
Mingo.aggregate(grades_complex, [{$unwind: "$scores"}, {$pluck: "scores.score"}]);
returns an array of all scores in the 'grades_complex' dataset: [57.92947112575566, 21.24542588206755, 68.1956781058743, 67.95019716560351, 18.81037253352722, 39.17749400402234, ...]
*/
Mingo.addOperators(Mingo.OP_PIPELINE, function(m) {
return {
@jorisvddonk
jorisvddonk / scriptInjector.js
Created March 19, 2015 20:51
ScriptInjector Chrome snippet - WIP
/*
* ScriptInjector-snippet
* Copyright (c) 2015 Joris van de Donk
* Snippet that can be used to inject JavaScript and CSS into a page.
* Uses cdnjs.com's CDN and APIs.
* Licensed under the MIT license.
* Very WIP as of yet ;)
*/
(function() {
---
- hosts: all
sudo: True
tasks:
- name: Install package via apt
apt: pkg=mc
@jorisvddonk
jorisvddonk / linux_cmd_result
Created August 6, 2013 06:59
Fabric test case success (test case: https://gist.github.com/jorisvddonk/6162658) on Linux
joris@vagrant:~$ fab test_func
Fabric version: 1.7.0
[localhost] local: env | grep foo
foo=bar
[localhost] local: env | grep baz
baz=qux
Done.