Skip to content

Instantly share code, notes, and snippets.

View Hilzu's full-sized avatar
🙃
'undefined' is not an object

Santeri Hiltunen Hilzu

🙃
'undefined' is not an object
View GitHub Profile
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJRnRMIfi41piWyEq8RHI/sOPG3BpyZW55L9dE8x+WBF hilzu@CentralDogma
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILBc0P1yI+0BZdSCs/gxPvHjKo5Mks4ouR6XO7lB2ydc hilzu@CentralDogma # WSL Ubuntu
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIMotbhHHOZStk6r5juljJdlT9MeshNiVLLi/iBXaMPu hilzu@Turbokala.local
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN5uCKND2tIc5VHCSVX62/Hg/ruOHER/JfZmlPlyE6Fa hilzu@mako
# Run npm install in folders with package.json excluding node_modules
find . -type d \( -name node_modules -o -name .webpack \) -prune -false -o -type f -name package.json -execdir pwd \; -execdir npm install \;
@Hilzu
Hilzu / index.html
Created March 22, 2021 13:32
ZELzrMG
<table id="table">
<tbody>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
</tr>
@Hilzu
Hilzu / BatchTransform.mjs
Created November 30, 2020 12:56
Node.js transform stream that batches chunks
import { Transform } from 'stream';
class BatchTransform extends Transform {
#batchSize = 0;
#batch = [];
constructor(options = { batchSize: 10 }) {
super({ objectMode: true });
this.#batchSize = options.batchSize;
}
@Hilzu
Hilzu / ssh-tunnel.service
Last active July 1, 2019 11:00
Reverse SSH tunnel to a bastion machine with a systemd service
[Unit]
Description=Reverse SSH tunnel to a bastion machine
After=network.target
[Service]
ExecStart=/usr/bin/ssh -NT -o ExitOnForwardFailure=yes -o ServerAliveInterval=60 -R 2222:localhost:22 10.0.0.1
Restart=always
[Install]
WantedBy=multi-user.target
@Hilzu
Hilzu / Dockerfile
Created March 26, 2018 15:51
Jenkins running with Docker and using docker in builds
FROM jenkins/jenkins:lts-alpine
USER root
RUN apk update && apk add docker

Keybase proof

I hereby claim:

  • I am hilzu on github.
  • I am hilzu (https://keybase.io/hilzu) on keybase.
  • I have a public key ASBLExJxXyS8ycd2CQ-SRIIML79mlun2JZjGrvxl7OrncQo

To claim this, I am signing this object:

@Hilzu
Hilzu / update-yarn-deps.sh
Last active August 4, 2017 12:26
Remove yarn lockfile and recreate it to update dependencies to latest versions allowed by package.json
#!/usr/bin/env bash
set -e
for package in "$@"
do
echo
echo "Updating $package"
cd "$package"
git checkout master
@Hilzu
Hilzu / update-git-repos.sh
Last active August 4, 2017 12:33
Pull latest changes in all given repos and run custom command after updating
#!/usr/bin/env bash
set -e
POST_PULL_CMD=${POST_PULL_CMD:-yarn}
for package in "$@"
do
echo
echo "Updating ${package}"
@Hilzu
Hilzu / webpack.config.js
Last active August 1, 2017 12:17
Webpack config with extractTextPlugin
/* eslint-env node */
"use strict";
const path = require("path");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = env => ({
devtool: env.production ? "source-map" : "cheap-module-eval-source-map",
entry: "./src/index.js",
output: {
filename: "./scripts/bundle.js",