Skip to content

Instantly share code, notes, and snippets.

View timsuchanek's full-sized avatar
🐋

Tim Suchanek timsuchanek

🐋
View GitHub Profile
@steebchen
steebchen / check.sh
Last active June 9, 2020 07:34
Check if a given Github Action succeeds
#!/bin/sh
# This script checks if the prisma e2e test workflow passes
# Check the end of the file for usage
check() {
str=$(curl -s "https://github.com/$1/workflows/$2/badge.svg")
case "$str" in
*"passing"*)
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
@LukeChannings
LukeChannings / rsort.js
Created September 19, 2018 08:31
rsort - recursively sort a data structure
const rsort = data => {
if (Array.isArray(data)) {
if (data.every(a => /(string|number|undefined)/.test(typeof a) || a === null)) return data.sort()
return data.map(rsort).sort()
}
if (typeof data === 'object' && data !== null) {
return Object.entries(data)
.sort(([k], [_k]) => k > _k)
.reduce((o, [k, v]) => ({ ...o, [k]: rsort(v) }), {})
@kbrandwijk
kbrandwijk / _Integration ideas.md
Last active September 28, 2018 04:46
Graphcool-AWS integration ideas

Graphcool and AWS functions

Context

I have a Graphcool project definition, with multiple stages, and I have a Serverless AWS definition. I use the Serverless AWS definition to deploy all of my functions, and I link them to Graphcool by using Webhooks. This document describes some of the ideas for linking those two deployments together.

Information exchange

So what kind of information do the Graphcool service and the Serverless service need to know about each other in order to connect?

@jevakallio
jevakallio / reactiveconf-slam-poetry.md
Last active July 7, 2021 19:57
#ReactiveConf 2017 Lightning Talk Submission: JavaScript Slam Poetry

TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.

JavaScript Slam Poetry

Javascript! Slam! Poetry!

@aparajita
aparajita / npmls.js
Last active January 4, 2020 00:07
npmls: A (much) better npm listing tool
#!/usr/bin/env node
"use strict";
const child_process = require("child_process");
const fs = require("fs");
const help = `Usage: npmls.js [-gh|--help] [filter...]
** Requires Node >= 4 **
// ensure the keys being passed is an array of key paths
// example: 'a.b' becomes ['a', 'b'] unless it was already ['a', 'b']
const keys = ks => Array.isArray(ks) ? ks : ks.split('.')
// traverse the set of keys left to right,
// returning the current value in each iteration.
// if at any point the value for the current key does not exist,
// return the default value
const deepGet = (o, kp, d) => keys(kp).reduce((o, k) => o && o[k] || d, o)
@mnot
mnot / snowden-ietf93.md
Last active September 12, 2023 13:40
Transcript of Edward Snowden's comments at IETF93.
@mbostock
mbostock / .block
Last active February 25, 2024 17:46
Closest Point on Path
license: gpl-3.0
@npow
npow / dnd.js
Created July 3, 2012 23:36
PhantomJS drag and drop
var page = require('webpage').create();
page.open('http://jsbin.com/ifuma#noedit', function () {
setTimeout(function () {
page.sendEvent("mousedown", 10, 10);
page.sendEvent("mousemove", 200, 200);
page.sendEvent("mouseup", 200, 200);
page.render('ss.png');
phantom.exit();
}, 3000);
});