Skip to content

Instantly share code, notes, and snippets.

Download from website: openssl s_client -connect online.banno-uat.com:443
Display info about private key: openssl rsa -text -in private-key.pem -noout
Display info about public key: openssl pkey -inform PEM -pubin -in pub.key -text -noout
Display info about cert: openssl x509 [-days 365] -text -in cert.pem -noout
Get public key from cert: openssl x509 -pubkey -noout -in cert.pem > pubkey.pem
Convert from PEM to CER:
openssl x509 -inform PEM -in online.pem -outform DER -out cert.cer
@eheikes
eheikes / steps.md
Last active August 26, 2019 20:39
Contributing Types

Prep

First check if the original package is maintained and open to adding types. Check if the package is being actively maintained; if so, create an issue (or look for existing/closed issues) asking for types to be added, and if the maintainers would be open to merging a PR for it.

If the original package can't have the types, they should be added to Definitely Typed. Check in the DT issues/PRs if anyone else is already working on this.

Implementation

If no one else is working on it, we're good to create a PR adding them:

@eheikes
eheikes / notes.md
Last active April 10, 2019 21:51
Jasmine -> Jest migration (WIP)

Migration Steps

  1. yarn add ts-jest jest @types/jest --dev
  2. yarn remove jasmine jasmine-spec-reporter jasmine-ts ts-node proxyquire @types/jasmine @types/proxyquire
  3. yarn ts-jest config:init
  4. Modify jest.config.js if needed.
    • Add modulePathIgnorePatterns: ['.yarn-cache'] if there is a .yarn-cache folder; otherwise you'll get a lot of jest-haste-map errors when running tests.
  5. Update the npm scripts. Give it the folder of tests you want to run (Jest matches against the pattern). Use --verbose to see the breakdown.
    • e.g. NODE_ENV=test jest test/unit --verbose
  • e.g. NODE_ENV=test jest test/unit --verbose --watch
@eheikes
eheikes / medium-popup.js
Last active August 7, 2018 04:21
Tampermonkey snippet for Medium.com
// ==UserScript==
// @name Hide medium.com popup
// @version 1.0
// @namespace https://medium.com
// @description Removes the signup request popup
// @author Eric Heikes
// @match https://medium.com/*
// @grant none
// ==/UserScript==
@eheikes
eheikes / _Karma_Jasmine_Typescript_browser.md
Last active October 28, 2023 14:51
Karma test runner with Jasmine + TypeScript + browser

This is an example setup for using the Karma test runner with a browser-based project written in TypeScript, using Jasmine as the test framework.

Known Issues:

  • Jasmine's fdescribe/fit doesn't work as expected; see note and workaround in the karma.conf.js below.
  • Karma won't restart if a declaration in types changes.
@eheikes
eheikes / gh-projects.md
Last active April 11, 2018 16:34
Evaluation of GitHub projects

Using GitHub Projects

Pros

  • has automation option that works better than Waffle's buggy hooks
  • can track issues across organization repos without a "placeholder" or "main" repo
  • can just create a "card" (not a full-fledged GH issue)
  • has different templates (automated and manual)
  • don't need GH labels for statuses (in progress, needs review, etc); project columns track that
@eheikes
eheikes / gh-projects.md
Created April 11, 2018 16:28
Evaluation of GitHub projects

Using GitHub Projects

Pros

  • has automation option that works better than Waffle's buggy hooks
  • can track issues across organization repos without a "placeholder" or "main" repo
  • can just create a "card" (not a full-fledged GH issue)
  • has different templates (automated and manual)
  • don't need GH labels for statuses (in progress, needs review, etc); project columns track that
@eheikes
eheikes / test.ssml
Created December 28, 2017 04:18
example SSML file
<speak>
<prosody pitch="x-low">
It is safe to assert that no other country has such a distinctive form of landscape gardening as Japan. In English, French, Italian, and Dutch gardens, however original in their way, there are certain things they seem all to possess in common: terraces, which originally belonged to Italian gardens, were soon introduced into France; clipped trees, which were a distinctive feature of Dutch gardens, were copied by the English; the fashion of decorating gardens with flights of stone steps, balustrades, fountains, and statues at one time spread from Italy throughout Europe; and possibly the over-decoration of gardens led to a change in taste in England and a return to a more natural style. The gardens of China and Japan have remained unique; the Eastern style of gardening has never spread to any[2] other country, nor is it ever likely to; for, just as no Western artist will ever paint in the same manner as an Oriental artist because his whole artistic sense is different, so no Weste
@eheikes
eheikes / gutenberg.js
Created October 4, 2017 03:09
Add Gutenberg print CSS
// ==UserScript==
// @name Gutenberg
// @namespace https://github.com/BafS/Gutenberg
// @version 1.0
// @description Adds print CSS
// @author Eric Heikes
// @include *
// @exclude http*://localhost
// @grant none
// ==/UserScript==
@eheikes
eheikes / gifenc.sh
Created September 7, 2017 17:15
Convert video to gif using appropriate palette (no dithering)
#!/bin/sh
# From the great article at http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
palette="/tmp/palette.png"
filters="fps=15,scale=640:-1:flags=lanczos"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2