Skip to content

Instantly share code, notes, and snippets.

View macbre's full-sized avatar
🏠
Working from home

Maciej Brencz macbre

🏠
Working from home
View GitHub Profile
@kaaquist
kaaquist / podman_macos.md
Last active May 4, 2024 22:37
Podman with docker-compose on MacOS.

Podman with docker-compose on MacOS.

Podman an alternative to Docker Desktop on MacOS

Getting podman installed and started is super easy.
Just use brew to install it.

> brew install podman

Now since podman uses a VM just like the Docker Client on MacOS we need to initialize that and start it.

@sindresorhus
sindresorhus / esm-package.md
Last active May 4, 2024 15:48
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@hnakamur
hnakamur / Dockerfile
Created June 11, 2020 00:27
Dockefile to build nginx-quic with BoringSSL on Ubuntu 20.04 LTS
FROM ubuntu:20.04
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install git mercurial build-essential cmake ninja-build golang-go zlib1g-dev libpcre3-dev
RUN git clone https://github.com/google/boringssl \
&& cd boringssl \
&& mkdir build \
&& cd build \
&& cmake -GNinja .. \
anonymous
anonymous / equality.js
Created January 22, 2018 09:29
function A() {
this.counter = 0;
}
a = new A('Gabby');
A.prototype.toString = function dogToString() {
this.counter += 1;
return this.counter;
}
@macbre
macbre / remove_dangling_images.sh
Created December 29, 2017 13:53
Docker helpers
#!/bin/bash
docker rmi -f $(docker images -f "dangling=true" --format "{{.ID}}")
@macbre
macbre / docker_clean.sh
Created December 18, 2016 13:41
Docker utils
IMAGES=`docker ps -a | grep -E 'Exited|Created' | awk '{print $1}'`
df -h | head -n2
for IMAGE in $IMAGES
do
docker rm $IMAGE
done
df -h | head -n2

Before you start

Make sure you have python, OpenFace and dlib installed. You can either install them manually or use a preconfigured docker image that has everying already installed:

docker pull bamos/openface
docker run -p 9000:9000 -p 8000:8000 -t -i bamos/openface /bin/bash
cd /root/openface
@gilbitron
gilbitron / .env.travis
Last active August 12, 2023 08:06
Laravel 5 Travis CI config
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@poros
poros / pytest_parametrize_ids.py
Created October 6, 2015 01:38
Parametrized pytest testcase with dictionary of parameters and human readable testcase names
test_params = {
'empty_line': ('', {}),
'get_ok': ('GET 200', {'request': 'GET', 'status': '200'}),
'get_not_found': ('GET 404', {'request': 'GET', 'status': '404'}),
}
@pytest.mark.parametrize('line,expected', test_params.values(), ids=test_params.keys())
def test_decode(self, line, expected):
assert Decoder().decode(line) == expected
@macbre
macbre / compare.js
Last active February 2, 2019 10:53
Headless browsers comparison
var webpage = require('webpage'),
page = webpage.create(),
fs = require('fs'),
args = require('system').args;
var engine = args[1];
// @see http://phantomjs.org/api/webpage/handler/on-console-message.html
page.onConsoleMessage = function(msg) {
console.log(msg);