Skip to content

Instantly share code, notes, and snippets.

@Nielio
Nielio / compose.yml
Last active May 23, 2022
Gitlab CE with build in Container Registry behind Traefik 2 with Letsencrypt
View compose.yml
version: "3.6"
services:
gitlab:
image: gitlab/gitlab-ce
volumes:
- gitlab-data:/var/opt/gitlab
- gitlab-logs:/var/log/gitlab
- gitlab-config:/etc/gitlab
networks:
- traefik-public
@herzig
herzig / esp-idf_i2c_scan
Created Aug 9, 2019
esp32 i2c scan (esp-idf)
View esp-idf_i2c_scan
// setup i2c master
static esp_err_t i2c_master_init()
{
i2c_config_t conf;
conf.mode = I2C_MODE_MASTER;
conf.sda_io_num = I2C_SDA_PIN;
conf.scl_io_num = I2C_SCL_PIN;
conf.sda_pullup_en = GPIO_PULLUP_ENABLE;
conf.scl_pullup_en = GPIO_PULLUP_ENABLE;
conf.master.clk_speed = I2C_MASTER_FREQ_HZ;
@matheusgontijo
matheusgontijo / magento-2-debugging-tricks-mysql-query-fetchall-fetchrow-data-hydrate-and-xdebug.php
Created Jun 10, 2019
Magento 2 Debugging Tricks - MySQL Query, fetchAll, fetchRow, Data Hydrate & PHP xDebug by Matheus Gontijo
View magento-2-debugging-tricks-mysql-query-fetchall-fetchrow-data-hydrate-and-xdebug.php
Magento 2 Debugging Tricks - MySQL Query, fetchAll, fetchRow, Data Hydrate & PHP xDebug by Matheus Gontijo
Video: https://www.youtube.com/watch?v=xLf3OwpAFhQ
-----------------------------------------------
1) Track MySQL queries
vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php::query
vendor/magento/zendframework1/library/Zend/Db/Select.php
View hass-icons.txt
hass:account
hass:alert
hass:alert-circle
hass:altimeter
hass:apple-safari
hass:apps
hass:arrow-bottom-left
hass:arrow-down
hass:arrow-left
hass:arrow-right
@ivanvermeyen
ivanvermeyen / HOWTO.md
Last active Apr 6, 2022
Multiple MySQL versions on MacOS with Homebrew
View HOWTO.md

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@leymannx
leymannx / iterm2-oh-my-fish.md
Last active Jun 23, 2022
iTerm2 Solarized Dark theme + Fish shell + oh-my-fish /// macOS High Sierra
View iterm2-oh-my-fish.md
@stecman
stecman / Makefile
Last active May 30, 2022
DS18B20 1-Wire implementation for Atmel AVR
View Makefile
DEVICE = atmega328p
CLOCK = 16000000
PROGRAMMER = -c arduino -P /dev/ttyUSB0 -b57600
AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE)
SOURCES = $(shell find . -name '*.c')
OBJECTS = $(SOURCES:.c=.o)
# Automatic dependency resolution
@marinsagovac
marinsagovac / Mailhog + Symfony 3
Last active Mar 29, 2021
Mailhog + Symfony 3
View Mailhog + Symfony 3
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
->setFrom('send@example.com')
->setTo('recipient@example.com')
->setBody('You should see me from the profiler!')
;
$this->get('mailer')->send($message);
@rkrzr
rkrzr / auto_tags.py
Last active Apr 5, 2022
Automatically generate ansible tags of the same name for each role in a playbook
View auto_tags.py
"""
This module implements an Ansible plugin that is triggered at the start of a playbook.
The plugin dynamically generates a tag for each role. Each tag has the same name as its role.
The advantage of this is that it saves you some boilerplate, because you don't have to wrap
all tasks of a role in an additional block and assign a tag to that.
Additionally, it works automatically when you add new roles to your playbook.
Usage is exactly the same as without this plugin:
@samelhusseini
samelhusseini / microbit-spotify.js
Last active Mar 29, 2022
A node script for listening to micro:bit serial messages and controlling spotify on a Mac
View microbit-spotify.js
var SerialPort = require("serialport");
const Readline = SerialPort.parsers.Readline;
var spotify = require('spotify-node-applescript');
var port = new SerialPort('/dev/tty.usbmodem1422', {
baudRate: 115200,
autoOpen: false
})
const parser = new Readline();
port.pipe(parser);