Skip to content

Instantly share code, notes, and snippets.

View TeemuKoivisto's full-sized avatar

Teemu Koivisto TeemuKoivisto

View GitHub Profile
@TeemuKoivisto
TeemuKoivisto / eslint.config.js
Created June 4, 2024 21:14
eslint.config.js
import js from '@eslint/js'
import ts from 'typescript-eslint'
import svelte from 'eslint-plugin-svelte'
import prettier from 'eslint-config-prettier'
import globals from 'globals'
/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
js.configs.recommended,
...ts.configs.recommended,
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["svelte3", "@typescript-eslint", "eslint-plugin-import", "eslint-plugin-prettier"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"env": {
"es6": true,
"browser": true,
"node": true
},
@TeemuKoivisto
TeemuKoivisto / aws.sh
Last active June 30, 2024 16:26
Installs AWS CLI v2 with Bash for Linux x86 / ARM
#!/bin/bash
# or for alpine #!/bin/sh
########################################################
# Installs AWS CLI v2 https://docs.aws.amazon.com/cli/ #
########################################################
# Needs curl or wget and unzip installed
# If you are using Alpine, you should use apk directly (because reasons https://github.com/aws/aws-cli/issues/4971)
# apk add aws-cli=2.13.5-r0
@TeemuKoivisto
TeemuKoivisto / ext
Last active November 30, 2022 15:43
https://drive.google.com/file/d/14heSnXHGXAM7KSrN3rLpdU3DTpX1554w/view?usp=sharing
https://drive.google.com/file/d/1aVV1PmguPnJRVMAdp33F-1jgC07VYRXc/view?usp=sharing
https://drive.google.com/file/d/1ndclz_UZi7NuiNbSmT_AmLyC9m2qUvJZ/view?usp=sharing
https://drive.google.com/file/d/1tMIDjYAgS4d1EQHs54rP8MaIhLbe0yXy/view?usp=sharing
@TeemuKoivisto
TeemuKoivisto / db-migrate.yml
Created May 10, 2022 06:06
Github action to migrate Postgres DB in Heroku with pnpm and Prisma
name: Migrate Heroku DB
on:
push:
branches:
- main
workflow_dispatch:
inputs:
run_seed:
description: 'Run post migrate operation: <none> | seed'
@TeemuKoivisto
TeemuKoivisto / onNavigation.ts
Last active October 6, 2021 08:43
Very rough hack to prevent navigation in SvelteKit
let currentLocation = ''
/**
* Usage:
* @example
* import { onDestroy, onMount } from 'svelte'
* import { onNavigation } from '$utils/onNavigation'
*
* let offNavigation: () => void
@TeemuKoivisto
TeemuKoivisto / Editor.tsx
Last active January 22, 2024 14:04 — forked from esmevane/index.tsx
Updated ProseMirror + React example with TypeScript and styled-components from @esmevane using NodeViews
import * as React from 'react'
import ReactDOM from 'react-dom'
import { EditorState } from 'prosemirror-state'
import { EditorView } from 'prosemirror-view'
import { Node, Schema } from 'prosemirror-model'
import applyDevTools from 'prosemirror-dev-tools'
import styled from 'styled-components'
// Here we have the (too simple) React component which
// we'll be rendering content into.
@TeemuKoivisto
TeemuKoivisto / Editor.tsx
Last active June 24, 2019 12:23
Updated ProseMirror + React example with TypeScript and styled-components from @esmevane https://gist.github.com/esmevane/7326b19e20a5670954b51ea8618d096d
import * as React from 'react'
import ReactDOM from 'react-dom'
import { EditorState } from 'prosemirror-state'
import { EditorView } from 'prosemirror-view'
import { Node, Schema } from 'prosemirror-model'
import applyDevTools from 'prosemirror-dev-tools'
import styled from 'styled-components'
// Here we have the (too simple) React component which
// we'll be rendering content into.
from pyspark import SparkContext, SparkConf
import os
import sys
#datasets path on shared group directory on Ukko2. Uncomment the one which you would like to work on.
dataset = "/proj/group/distributed-data-infra/data-1-sample.txt"
#dataset = "/proj/group/distributed-data-infra/data-1.txt"
#dataset = "/proj/group/distributed-data-infra/data-2-sample.txt"
#dataset = "/proj/group/distributed-data-infra/data-2.txt"
@TeemuKoivisto
TeemuKoivisto / HADOOP-ON-K8S.md
Last active December 1, 2022 12:21
How to install Hadoop to your local Kubernetes cluster

How to install Hadoop on your local Kubernetes cluster

Okey this is not the easiest way of running Hadoop on your local computer and probably you should instead just install it locally.

However if you really insist doing this here's how:

  1. Install kubectl, minikube and Docker if you don't already have it. I recommend using package-manager like Chocolatey. Minikube should install with VirtualBox as default driver which I recommend. When starting minikube we should increase its memory limit since our Hadoop node's pods need at least 2GB: minikube --memory 4096 --cpus 2 start (minikube's default is 1GB). NOTE: actually the Hadoop cluster by default uses about 10GB in memory limits and about 3GB running memory. From what I looked my k8s will overprovision to 300% of its capacity limits but use far less.
  2. Install helm. Then run helm init.
  3. Now you