Skip to content

Instantly share code, notes, and snippets.

View NiklasMerz's full-sized avatar

Niklas Merz NiklasMerz

View GitHub Profile
@colinfwren
colinfwren / zoomingWithReactKonva.js
Created February 21, 2021 18:41
Zooming on desktop and mobile with react-konva
import { Stage, Layer } from 'react-konva';
import MyLargeComponent from './thingToRenderOnStage';
const scaleBy = 1.01;
function getDistance(p1, p2) {
return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
}
function getCenter(p1, p2) {
@colinfwren
colinfwren / PanningKonvaStage.js
Created February 21, 2021 16:33
Panning a stage in react-konva
import { Stage, Layer } from 'react-konva';
import MyLargeComponent from './thingToRenderOnStage';
function App() {
return (
<Stage width={window.innerWidth} height={window.innerHeight} draggable>
<Layer id='stuffToShow'>
<MyLargeComponent />
</Layer>
</Stage>
@PatrickLang
PatrickLang / README.md
Last active February 24, 2023 20:05
Yubikey + Windows

Using a Yubikey 4 on Windows

These are my notes on how to set up GPG with the private key stored on the hardware Yubikey. This will reduce the chances of your GPG private key from being stolen, and also allow you to protect other secrets such as SSH private keys.

It's just some notes and a partial worklog for now, but I may turn it into a full blog post later.

@johnpapa
johnpapa / Agenda.md
Last active April 13, 2020 10:18
Angular Fundamentals Workshop Setup Instructions

Angular Fundamentals

Do you want to get a jumpstart on developing with Angular so you can build robust Web applications? Learn how to work with data binding, create components, and communicate across components with input/output bindings. You'll learn how to abstract logic into client-side services, provide services using the Angular injectors, and take advantage of dependency injection. When it's time to communicate with a server, you'll need to talk over HTTP. We'll learn how to send and receive data to and from a server using Http and use RxJS and observables.

You'll also learn how to get up and running quickly with the Angular CLI. Bring your laptop, as you’ll be writing Angular code using what you learn in several hands-on exercises.

What you'll learn

Learn about the Angular framework, the requirements to getting started, and the basic of TypeScript.

@zabirauf
zabirauf / renew-mongo-cert.sh
Last active January 26, 2024 16:23
Renew certificate using certbot for MongoDB
#!/bin/bash
# Define variables
DOMAIN=foo.example.com
# renew cert
certbot renew
# combine latest letsencrypt files for mongo
@novemberfiveco-gists
novemberfiveco-gists / WKCookieWebView.swift
Last active June 26, 2023 10:02
A WKWebView subclass that passes cookies after a 302 redirect response.
//
// WKCookieWebView.swift
//
// Created by Jens Reynders on 30/03/2018.
// Copyright (c) 2018 November Five
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@RinatMullayanov
RinatMullayanov / Dockerfile
Last active August 1, 2023 22:13
Ubuntu Node.js Dockerfile
#
# Ubuntu Node.js Dockerfile
#
# https://github.com/dockerfile/ubuntu/blob/master/Dockerfile
# https://docs.docker.com/examples/nodejs_web_app/
#
# Pull base image.
FROM ubuntu:14.04
@ftvs
ftvs / PhonecallReceiver.java
Last active October 11, 2023 10:05
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: Gabe Sechan http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {