Skip to content

Instantly share code, notes, and snippets.

Jussi Räsänen jrasanen

Block or report user

Report or block jrasanen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View until-docker.sh
#!/bin/bash
until docker info &> /dev/null
do
echo "Waiting for the docker engine to start ..."
sleep 1
done
docker-compose up
View http-debug-server.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Usage:
python3 http-debug-server.py -a <bind-address> -p <bind-port>
'''
import json
import string
from pprint import pprint
View layer-0.json
["~\n`","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=",{w:2},"Backspace"],
[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{w:1.5},"|\n\\"],
[{w:1.75},"Esc","A","S","D","F","G","H","J","K","L",":\n;","\"\n'",{w:2.25},"Enter"],
[{w:2.25},"LShift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:2.75},"RShift"],
[{w:1.25},"LCtrl",{w:1.25},"LAlt",{w:1.25},"LWin",{w:6.25},"Space",{w:1.25},"Fn0",{w:1.25},"RWin",{w:1.25},"Menu",{w:1.25},"RCtrl"]
View layer-1.json
["Esc","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12",{w:2},"Delete"],
[{a:7,w:1.5},"",{a:4},"F13","Up","Fn4","Fn5","Fn7","Fn9","F14","Prtsc","Scrlk","Pause\nBreak","Up","F15",{w:1.5},"Insert"],
[{a:7,w:1.75},"",{a:4},"Left","Down","Right","Fn6","Fn8","Fn10",{a:7},"",{a:4},"Home","Pgup","Left","Right",{a:7,w:2.25},""],
[{a:4,w:2.25},"LShift","Fn2","Fn1","Fn3",{a:7},"",{a:4},"Voldn","Volup","Mute","End","Pgdn","Down",{w:2.75},"RShift"],
[{w:1.25},"LCtrl",{w:1.25},"LAlt",{w:1.25},"LWin",{w:6.25},"Fn11",{a:7,w:1.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},""]
@jrasanen
jrasanen / layout.kbd.json
Created Nov 20, 2018 — forked from mmynsted/layout.kbd.json
Untitled Keyboard Layout
View layout.kbd.json
[
[
"Esc",
"F1",
"F2",
"F3",
"F4",
"F5",
"F6",
"F7",
@jrasanen
jrasanen / aws-kms-policy.json
Last active May 17, 2018
AWS kms inline policy
View aws-kms-policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"kms:Decrypt",
"kms:Encrypt",
"kms:GenerateDataKey",
View ollionparas.sql
-- Tested on
-- PostgreSQL 9.6.2 (rds, db.t2.micro)
-- PostgreSQL 10.3 (rds, db.t2.micro)
create table stuff (
id bigserial primary key,
firstname text,
lastname text,
amount integer,
created_at timestamp default current_timestamp
);
View main.tf
provider "aws" {
region = "eu-central-1"
}
#
# Create DynamoDB table
# columns: userId, noteId
#
resource "aws_dynamodb_table" "jr-notes-1" {
name = "jr-notes-1"
View uuid-ish.js
// Random quick uuidv4 implementation
// https://gist.github.com/jed/982883
const b = (
a // placeholder
) => {
return a // if the placeholder was passed, return
? ( // a random number from 0 to 15
a ^ // unless b is 8,
Math.random() // in which case
* 16 // a random number from
View a.rb
numbers = [50, 43, 73, 22]
data = numbers.map.with_index do |x, i|
return { "a": i, "b": x }
end
puts(data) // => {"a"=>0, "b"=>50}
You can’t perform that action at this time.