Skip to content

Instantly share code, notes, and snippets.

View novascreen's full-sized avatar

Thomas Hermann novascreen

View GitHub Profile
@novascreen
novascreen / redact.test.ts
Created September 11, 2019 02:22
Ramda Redact
import { redact } from './redact'
test('replaces given paths with [Redacted]', () => {
const data = { secret: '1234', nested: { secret: '5678' } }
const redactedData = redact([['secret'], ['nested', 'secret']], data)
const curriedRedactedData = redact([['secret'], ['nested', 'secret']])(data)
expect(redactedData).toMatchInlineSnapshot(`
Object {
"nested": Object {

Keybase proof

I hereby claim:

  • I am novascreen on github.
  • I am novascreen (https://keybase.io/novascreen) on keybase.
  • I have a public key ASBt0Xe3dQwM9vWHOTQwLOkGdkIDf0t99q8rDI1EQCfPywo

To claim this, I am signing this object:

@novascreen
novascreen / README.md
Last active November 18, 2021 08:11
How to mock next/router in Storybook

If you use Storybook with Next.js and have components using next/link you'll have to mock next/router the same you would for testing with Jest or others. Simply create a file with the mock router as shown below and import it in your Storybook config.

This is based on some information from an issue on Next.js:

vercel/next.js#1827

@novascreen
novascreen / gist:6bd63a04320ffeb15c87e761277cd733
Created February 21, 2017 16:43
.hyper.js with PowerShell
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 13,
// font family with optional fallbacks
fontFamily: 'Hack, Monaco, Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 13,
// font family with optional fallbacks
fontFamily: 'Hack, Monaco, Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
@novascreen
novascreen / fix-bin-links.js
Last active September 19, 2018 16:45
Workaround for Yarn bin links problem
cinst -y 7zip.install
cinst -y adobe-creative-cloud
cinst -y adobereader
cinst -y Firefox
cinst -y git
cinst -y google-chrome-x64
cinst -y GoogleChrome.Canary
cinst -y googledrive
cinst -y IrfanView
cinst -y irfanviewplugins
@novascreen
novascreen / gist:1216bc07f2739cd50113
Created November 18, 2015 05:11
vagrant provision error
==> default: Running provisioner: shell...
C:/HashiCorp/Vagrant/embedded/gems/gems/winrm-fs-0.2.0/lib/winrm-fs/core/command_executor.rb:59:in `assert_command_success': uninitialized constant WinRM::FS::Core::CommandExecutor::WinRMUploadError (NameError)
from C:/HashiCorp/Vagrant/embedded/gems/gems/winrm-fs-0.2.0/lib/winrm-fs/core/command_executor.rb:47:in `run_cmd'
from C:/HashiCorp/Vagrant/embedded/gems/gems/winrm-fs-0.2.0/lib/winrm-fs/core/command_executor.rb:38:in `run_powershell'
from C:/HashiCorp/Vagrant/embedded/gems/gems/winrm-fs-0.2.0/lib/winrm-fs/core/upload_orchestrator.rb:97:in `remote_checksum'
from C:/HashiCorp/Vagrant/embedded/gems/gems/winrm-fs-0.2.0/lib/winrm-fs/core/upload_orchestrator.rb:86:in `out_of_date?'
from C:/HashiCorp/Vagrant/embedded/gems/gems/winrm-fs-0.2.0/lib/winrm-fs/core/upload_orchestrator.rb:40:in `block in upload_file'
from C:/HashiCorp/Vagrant/embedded/gems/gems/winrm-fs-0.2.0/lib/winrm-fs/core/upload_orchestrator.rb:72:in `wi
# Basic setup
Update-ExecutionPolicy Unrestricted
Set-WindowsExplorerOptions -EnableShowHiddenFiles -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
Disable-InternetExplorerESC
Disable-UAC
Set-TaskbarOptions -Size small
# Install-WindowsUpdate -AcceptEula
@novascreen
novascreen / API.md
Last active September 9, 2015 19:32 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: