Skip to content

Instantly share code, notes, and snippets.

View bserem's full-sized avatar

Bill Seremetis bserem

View GitHub Profile
-- this is an example
group: ask4
katalima = {
kodikosK:number, onomaK:string, addressK:string, city:string
1, 'Lato', 'Kapou 5', 'Patra'
2, 'Menexes', 'Kapoy allou 4', 'Patra'
}
@bserem
bserem / LCDd.conf
Created June 17, 2017 05:38
HD44780 LibreElec 8 (.kodi/userdata/addon_data/service.lcdd/LCDd.conf)
# LCDd.conf -- configuration file for the LCDproc server daemon LCDd
#
# This file contains the configuration for the LCDd server.
#
# The format is ini-file-like. It is divided into sections that start at
# markers that look like [section]. Comments are all line-based comments,
# and are lines that start with '#' or ';'.
#
# The server has a 'central' section named [server]. For the menu there is
# a section called [menu]. Further each driver has a section which
@bserem
bserem / Android Privacy Policy Template
Created December 8, 2017 16:32 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@bserem
bserem / redirect_importer.sh
Last active March 8, 2018 14:15
Mass import redirects in Drupal 8 from CSV
#!/bin/bash
i=0
cat redir.csv| while read line
do
let "i++"
rsource=`echo $line | cut -d ',' -f1`
rtarget=`echo $line | cut -d ',' -f2`
redirect='use Drupal\redirect\Entity\Redirect;Redirect::create(["redirect_source" => "'$rsource
if [[ $rtarget = *"http"* ]]; then
@bserem
bserem / drupal8_menu_item_clone.sql
Created April 27, 2018 10:34
Clone Drupal 8 menu items to another menu and change their language code.
INSERT INTO menu_link_content_data
(
id,
bundle,
langcode,
title,
description,
menu_name,
link__uri,
link__title,
@bserem
bserem / update_mixxx_paths.sql
Created April 28, 2018 15:14
Change paths of files in MIXXX sqlite dabatase
/**
*Looks for directory *750GB* in the path and removes it for paths.
* Based on that you can do any replacements.
*/
UPDATE track_locations
SET location = replace (location, '750GB/', '')
where
location LIKE '%750G%';
@bserem
bserem / pre-commit
Created April 10, 2021 10:54
Run phpcs in ddev with Drupal standard on pre-commit.
#!/usr/bin/php
<?php
/**
* @file
* A Git pre-commit hook script to check files for PHP syntax errors and Drupal
* coding standards violations. Requires phpcs and Coder Sniffer:
*
* @see https://drupal.org/node/1419988
*
@bserem
bserem / prepare-commit-msg
Created May 4, 2021 14:02
Git hook to automatically add [skip ci] to commit message.
#!/bin/bash
exec < /dev/tty
read -n 1 -p "Would you like to run CI? (y/N) " ans;
ans=${ans:-n} # Default is no, always add [skip ci]
echo # Just add a new line
case $ans in
y|Y)
exit;;
n|N|*)
sed -i '$s/$/ [skip ci]/' $1;;
@bserem
bserem / commit-msg
Created January 20, 2022 11:53
Commit msg hook in PHP that follow https://cbea.ms/git-commit
#!/usr/bin/php
<?php
$message = file_get_contents($argv[1]);
checkMessage($message);
exit(0);
function checkMessage($message) {
if (strlen($message) < 10) {
OS Information: Linux dragoon 5.16.0-1-amd64 #1 SMP PREEMPT Debian 5.16.7-2 (2022-02-09) x86_64 GNU/Linux
User information: uid=1000(bserem) gid=1000(bserem) groups=1000(bserem),4(adm),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),109(netdev),112(bluetooth),116(scanner),119(lpadmin),131(i2c),997(docker),998(nordvpn)
ITEM VALUE
DDEV version v1.18.2
architecture amd64
db drud/ddev-dbserver-mariadb-10.3:v1.18.2
dba phpmyadmin:5
ddev-ssh-agent drud/ddev-ssh-agent:v1.18.0
docker 20.10.12
docker-compose v2.2.2