Skip to content

Instantly share code, notes, and snippets.

View TeemuKoivisto's full-sized avatar

Teemu Koivisto TeemuKoivisto

View GitHub Profile
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 / 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.
@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 / 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 / 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 / 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 / aws.sh
Last active September 7, 2023 16:57
Installs AWS CLI v2 with Bash for Linux x86 / ARM
#!/usr/bin/env 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
{
"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 / 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,