Skip to content

Instantly share code, notes, and snippets.

View BirgitPohl's full-sized avatar
🎯
Focusing on impactful projects

Birgit Pohl BirgitPohl

🎯
Focusing on impactful projects
View GitHub Profile
@BirgitPohl
BirgitPohl / hexToRgbA.ts
Created October 3, 2022 18:05
Hexadecimal to RGBA
/**
* @param hex HexColor #000000 #000
* @param opacity 0-100
* @returns `rgba(RR, GG, BB, 0.x)`
*/
export const hexToRgbA = <T extends string>(hex: HexColor<T>, opacity: number): T => {
let c;
if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){
c = hex.substring(1).split('');
if(c.length == 3){
@BirgitPohl
BirgitPohl / keybase.md
Created February 7, 2022 08:43
Keybase verification

Keybase proof

I hereby claim:

  • I am birgitpohl on github.
  • I am birgitpohl (https://keybase.io/birgitpohl) on keybase.
  • I have a public key ASDsnJR1Q1t_fjtpQY_J07NVf76ujyI-7EPA_JrPZInzzgo

To claim this, I am signing this object:

@BirgitPohl
BirgitPohl / .common-template.yml
Last active October 3, 2022 18:08
Whitlabel Deployment
# It assumes you have templates setup and to be recognized.
# the extends command takes the extension of this template Yaml file.
# A Kaniko example:
.docker-build:
stage: my-stage
only:
- master
image:
name: gcr.io/kaniko-project/executor:debug
@BirgitPohl
BirgitPohl / parseObject.ts
Created October 7, 2020 12:41
A collection of generic types for objects
import { testAgainstSchemaDeeply } from "./utils";
interface IMyObject {
name: string
{[key: string]: any}
}
class ObjectSchema {
name: any
}
@BirgitPohl
BirgitPohl / function-calls.feature
Last active April 19, 2020 15:56
Cypress & Cucumber
# Calls a function:
When I add 1 to my sum
@BirgitPohl
BirgitPohl / app.yaml
Created January 10, 2020 12:43
Problem with implicit data type conversion in Javascript
# Google App Engine configation
env_variables:
FEATURE_CORS_ENABLED: false
@BirgitPohl
BirgitPohl / MultiLineEllipsis.md
Last active July 3, 2019 14:27
Multiline Ellipsis using characters per line. A cross-browser solution.

Use of objects in typography.js

It is recommended to create an object, that stores the original text, so that you can use an event listener for fluid and responsive designs.

<quiz>
<film id="Mercury"
onCorrect="Very nice!
Here is more information: http://solarsystem.nasa.gov/planets/mercury"
onWrong="It is Mercury.
Here is more information: http://solarsystem.nasa.gov/planets/mercury">
<label>
<text>What is this celestial object?</text>
</label>
<label>
@BirgitPohl
BirgitPohl / Hanoi.java
Last active January 6, 2016 18:58
Goal is to write a hanoi tower program where discs can not jump from position A to C, they need to move to position B first in order to get to position C. It is a recursive solution. I took a look at the Sierpiński triangle on Wikipedia and figured out how it could work. https://en.wikipedia.org/wiki/Tower_of_Hanoi
public class Hanoi {
//Goal is to write a program where discs can not jump from position A to C, they need to move to position B in order to get to position C.
static void move (
int n, // Number of discs 'n'
char start, // start position
char help, // helping position (place in the middle)
char destination) { // destination position