Skip to content

Instantly share code, notes, and snippets.


Jack Tomaszewski jtomaszewski

View GitHub Profile
wpiekutowski / some_subscription_test.exs
Created August 7, 2020 13:34
Testing subscriptions: Elixir + Absinthe + Phoenix WebSocket
View some_subscription_test.exs
defmodule App.Schema.SomeSubscriptionTest do
use App.SubscriptionCase
test "subscription: someSubscription" do
subscription_query = """
subscription {
someSubscription {
royshouvik / console.ts
Last active October 4, 2022 00:12
Nestjs REPL
View console.ts
import 'dotenv/config';
import { NestFactory } from '@nestjs/core';
import * as repl from 'repl';
import * as Logger from 'purdy';
indent: 2,
depth: 1,
jack-sf / KeyboardFocusHandler.tsx
Created July 8, 2019 08:42
Add `.has-keyboard-focus` class to your `<body>` element whenever keyboard focus is active - as an easy solution to add focus outline to all keyboard-focused elements (until `:focus-visible` is supported in all the major browsers)
View KeyboardFocusHandler.tsx
import * as React from 'react';
import { document, window } from '../../../utils/browser';
export class KeyboardFocusHandler extends React.PureComponent {
componentDidMount(): void {
window!.addEventListener('keydown', this.handleFirstTab);
componentWillUnmount(): void {
tbutts /
Last active February 12, 2023 18:14
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./ ~/.tmux.conf.orig > ~/.tmux.conf
karthik101 / Readonly user for Kubernetes
Last active June 29, 2022 07:42
Read only user for Kubernetes Dashboard
View Readonly user for Kubernetes

The view ClusterRole doesn’t actually have permissions for the Cluster level objects like Nodes and Persistent Volume Claims. So we’ll have to create a new RBAC config.

First, we’ll create a new dashboard-viewonly ClusterRole:

kind: ClusterRole
  name: dashboard-viewonly
donaldpipowitch / axe.js
Created November 26, 2018 11:44
aXe based a11y checks in your CI for Storybook
View axe.js
const puppeteer = require('puppeteer');
const chalk = require('chalk');
const { green, red, cyan, grey, bold } = chalk;
// we assume storybook can visited at http://localhost:9001
const url = 'http://localhost:9001/iframe.html';
const runAxe = () =>
new Promise((resolve, reject) =>
vasilii-b / magento2-layout-empty-container.xml
Last active January 14, 2021 23:58
Adding an empty container in Magento 2 layout file
View magento2-layout-empty-container.xml
<container name="some.container" htmlTag="div" htmlClass="container">
<!-- Force container to render -->
<block class="Magento\Framework\View\Element\Text">
<argument name="text" xsi:type="string"><![CDATA[&nbsp;]]></argument>
mardr / mbank_unlifting.user.js
Last active April 15, 2019 18:25
Przywraca wygląd strony transakcyjnej mbanku z przed liftingu. Do działania wymaga jednego z rozszerzeń do przeglądarki: np. Greasemonkey lub Tampermonkey.
View mbank_unlifting.user.js
// ==UserScript==
// @name mbank unlifting
// @description Przywraca wygląd strony transakcyjnej mbanku z przed liftingu
// @version 0.1
// @grant none
// @author mardr
// @include*
// ==/UserScript==
baumandm /
Last active November 10, 2022 18:48 — forked from dergachev/
OS X Screencast to Animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime and ffmpeg.

Forked from Updated to use a palette to improve quality and skip gifsicle.


To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

NickClark / thoughts.markdown
Last active September 27, 2021 22:33
Elm vs TypeScript Thoughts
View thoughts.markdown

Elm and TypeScript

  • Elm Task - An Elm specific implementation of Observables (more limited?)
  • TS and Elm - Once it compiles it usually runs (Provided you're following the warnings provided in either the compiler output (better) or editor (best) )
  • Editor and tooling support?
  • TS and Elm - Typed Langs
  • Most suitable for complete apps, not just a JS compiler
  • Enforces Reactive programming - Angular 2 (Observables) provides the same thing, just not forced.
  • Know TS, know JS. Able to contribute back to the community easier.
  • Object assignment kinda weird: { point | x = 42 } Reason? (overall weird sytnax)