Skip to content

Instantly share code, notes, and snippets.

View TatuArvela's full-sized avatar

Tatu Arvela TatuArvela

View GitHub Profile
@TatuArvela
TatuArvela / generator.js
Last active September 1, 2021 15:07
Border shadow generator
const generate = (d, topLeftColor, bottomRightColor) => {
// Layers from bottom to top
const values = [
[d, -d, topLeftColor],
[-d, d, bottomRightColor],
[-d, d-1, topLeftColor],
[d, -d+1, bottomRightColor],
[-d, -d, topLeftColor],
[d, d, bottomRightColor],
];
@TatuArvela
TatuArvela / Jest.md
Last active May 28, 2021 11:56
Jest mocking, explained

Jest mocking, explained

Jest is a really nice testing framework, but sometimes figuring out the right way to mock a function can be tricky. This guide attempts to define the approaches one should use.

Class React components

Function React components

API calls

Media keys

Fn + F1 Mute
Fn + F2 Volume -
Fn + F3 Volume +
Fn + F4 Previous
Fn + F5 Play/Pause
Fn + F6 Next
@TatuArvela
TatuArvela / Slack Dark Plus.csv
Last active April 17, 2020 11:28
Visual Studio Code Dark+ theme for Slack
#333333 #3F3F3F #007AD2 #FFFFFF #1E1E1E #FFFFFF #23D18B #F14C4C #252526 #969696
@TatuArvela
TatuArvela / iTerm2 Hyper.itermcolors
Last active August 22, 2020 15:52
Hyper terminal default theme for iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@TatuArvela
TatuArvela / Java.md
Created February 28, 2020 08:37
Java, explained

Java, explained

The Java environment consists of several parts, and every part has multiple implementations, both proprietary and open source.

This document aims to give a short and simple explanation of the important parts. Misconceptions are possible, so please do not take this as legal advice.

Java, the platform

The Java platform was created by Sun Microsystems, which has since been acquired by Oracle.

@TatuArvela
TatuArvela / VGA palettes for GIMP
Last active November 7, 2023 01:58
VGA palettes for GIMP
VGA palettes for GIMP
* VGA, 16 colors
* VGA, 256 colors
@TatuArvela
TatuArvela / Windows Terminal Dark Plus.json
Last active December 5, 2022 22:33
Visual Studio Code Dark+ theme for Windows Terminal
{
"name": "Dark (Visual Studio)",
"background": "#1E1E1E",
"foreground": "#BBBBBB",
"black": "#000000",
"red": "#cd3131",
"green": "#0DBC79",
"yellow": "#e5e510",
"blue": "#2472c8",
"purple": "#bc3fbc",
@TatuArvela
TatuArvela / iTerm2 Dark Plus.itermcolors
Last active April 17, 2020 11:29
Visual Studio Code Dark+ theme for iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@TatuArvela
TatuArvela / audiocontrol
Created March 23, 2018 11:30
Audio Control widget (Python 2.7, Gtk 3.0, xdotool)
#!/usr/bin/env python
import gi
import os
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class AppWindow(Gtk.Window):
def __init__(self):