Skip to content

Instantly share code, notes, and snippets.

View bbredewold's full-sized avatar
🖖

Bert Bredewold bbredewold

🖖
  • The Netherlands
  • 03:04 (UTC +02:00)
View GitHub Profile
@renalpha
renalpha / DockerFile
Last active January 5, 2024 16:04
Traefik
FROM php:7.4-fpm
RUN apt-get update && apt-get install -y libldb-dev libldap2-dev libzip-dev libpng-dev libjpeg62-turbo-dev libfreetype6-dev \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-install -j$(nproc) zip pdo pdo_mysql gd ldap pcntl opcache
@mlewand
mlewand / renderRect.js
Last active July 31, 2023 09:16
DOMRect visualisation - a small helper for visualizing DOMRect objects.
( function() {
/**
* A helper function to visualize DOMRect or set of DOMRect instances.
*
* Subsequent calls will remove previously marked elements.
*
* Debug a element currently focused in your devtools inspector.
* window.markRect( $0.getBoundingClientRect() );
* // Debug a selection.
* window.markRect( document.getSelection().getRangeAt( 0 ).getClientRects() );
@daliborgogic
daliborgogic / entry-client.js
Last active July 1, 2019 09:51
Vue.js SPA Google Analytics
// https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)
)
@danielhanold
danielhanold / dkc-batch.sh
Last active November 3, 2023 13:51
Run multiple docker-compose files at once
#!/bin/bash
# @file
# If an application is comprised of multiple docker-compose.yml files, this file
# allows you to execute docker-compose commands for all files in a batch.
# For this to work, place this file into a directory and place each
# docker-compose environment in a subdirectory.
#
# Example:
# /maindir
@itod
itod / split_keyboards.md
Last active May 6, 2024 10:50
Every "split" mechanical keyboard currently being sold that I know of
@m2wasabi
m2wasabi / deploy.cmd
Created December 7, 2016 11:35
PHP autodeploy with Laravel example
@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.9
:: ----------------------
:: Prerequisites
:: -------------
@markokoleznik
markokoleznik / day03part1.py
Created December 3, 2016 21:58
Day 3, Part 1 (Python 3)
print(len(list(filter(lambda y: y[0] + y[1] > y[2], [sorted(list(map(int, x.split()))) for x in open('problem03/input.txt', 'r').read().split('\n')]))))
@EspadaV8
EspadaV8 / overrides.css
Last active May 19, 2020 06:58
Dark Laravel Docs theme
body {
color: #ccc;
background: #525252 url("/assets/img/cloud-bar.png") repeat-x;
}
.docs article code[class*="language-"],
.docs article pre[class*="language-"] {
font-size: 14px;
}
@phillipgreenii
phillipgreenii / README.md
Last active November 16, 2023 16:04
Running NPM Scripts through maven

I am in the process of introducing single page applications to where I work. For development, using node based build tools is much easier for the single page applications. However, the build process for our organization is based upon maven. Our solution started with the maven plugin frontend-maven-plugin. It worked great at first, but then we ran into a situation that I couldn't make work with it.

As stated before, at our organization, we have the older ecosystem which is maven and the newer ecosystem which is node. Our goal was to keep the hacking to a minimum. We did this by putting all of the hacks into a single super node based build file. This is what maven calls and the reason frontend-maven-plugin wasn't sufficient. The super node based build script calls all of the other build scripts by spawning npm run. Try as I might, I could not figure out how to make the spawn work. front-end-maven-plugin downloads npm

#!/bin/bash
# GUI-related packages
pkgs="
xserver-xorg-video-fbdev
xserver-xorg xinit
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa
gstreamer1.0-libav
epiphany-browser