Skip to content

Instantly share code, notes, and snippets.

View k0pernikus's full-sized avatar

Philipp Kretzschmar k0pernikus

View GitHub Profile
@k0pernikus
k0pernikus / bubbles-must-be-set-for-custom-events.js
Created November 12, 2024 12:13
custom event in do not bubble by default, one has to set bubbles true
const customEventHandling = () => {
document.addEventListener('this-is-my-custom-event', (event) => {
console.log('THIS SHOULD PRINT ON DISPATCHED EVENT!');
console.log(event)
});
document.onreadystatechange = () => {
if (document.readyState !== "complete") {
console.log('not ready yet');
@k0pernikus
k0pernikus / error.log
Created October 23, 2019 10:29
node-curl error during `yarn install`
yarn install
yarn install v1.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[-/6] ⠄ waiting...
[-/6] ⠄ waiting...
@k0pernikus
k0pernikus / package-lock.json
Last active July 26, 2019 12:17
Example of how one library can introduce a multiple thousand long lockfile via npm.
{
"name": "jest-test",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@babel/code-frame": {
"version": "7.5.5",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
"integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
@k0pernikus
k0pernikus / gist:ed2788130d15aca80cbdaf398da89719
Created May 14, 2018 11:51
highland error promise rejection
highland(range).map((i) => {
return highland(createPromise(i));
})
.flatten()
.errors((error, push) => {
if (error) {
push(null, null);
}
})
.compact()
@k0pernikus
k0pernikus / LazyFuture.scala
Created April 23, 2018 13:39
LazyFuture for scala, prototype, wip, based on stackoverflow answer
package com.dreamlines.commons
import scala.concurrent.{ExecutionContext, Future}
/**
* This LazyFuture helps working with futures with concurrency
*
* @param f
* @tparam A
*/
@k0pernikus
k0pernikus / transformHttpResponse.scala
Last active April 19, 2018 10:22
Transforming a Future of HttpResponse to a Future of a case class using generics through json4s
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model._
import akka.stream.Materializer
import akka.util.ByteString
import org.json4s._
import org.json4s.native.JsonMethods._
import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future}
FROM ubuntu:16.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq update
RUN apt-get -qq install software-properties-common > /dev/null
RUN apt-add-repository ppa:git-core/ppa > /dev/null
RUN apt-get -qq update && apt-get -qq install python3-pip curl vim net-tools bash
ADD https://deb.nodesource.com/setup_8.x nodesetup.sh
RUN bash ./nodesetup.sh
RUN apt-get -qq install nodejs
RUN node -v
@k0pernikus
k0pernikus / output.txt
Created October 26, 2016 15:33
Incredibly huge outout
Step 3 : RUN docker-php-ext-install soap
---> Running in 2d277c01808e
+ cd /usr/src/php/ext/soap
+ phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
+ ./configure
checking for grep that handles long lines and -e... /bin/grep
@k0pernikus
k0pernikus / tslint.json
Created September 29, 2016 11:32
tslint for nodejs why staying as close to tslint:recommended as possible
{
"extends": "tslint:recommended",
"rules": {
"no-console": false
}
}
@k0pernikus
k0pernikus / .htaccess
Last active May 30, 2016 13:50
Setup phalcon app via docker-compose using base php:5.6-apache image
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L]
</IfModule>