Skip to content

Instantly share code, notes, and snippets.

View b-alidra's full-sized avatar

Belkacem Alidra b-alidra

View GitHub Profile
@b-alidra
b-alidra / short_tags
Created April 23, 2015 08:31
Remove PHP short tags - Thanks to @kaworu
perl -i -pe 's/<\?(?!php|xml|=)/<?php /g' **/*.php
@b-alidra
b-alidra / keymap.xml
Created January 7, 2016 21:59
Minix A2 Lite keymap for Kodi
<keymap>
<global>
<keyboard>
<F1>SendClick(8)</F1>
<home>ActivateWindow(Home)</home>
<return>Select</return>
<leftwindows>ContextMenu</leftwindows>
<prev_track>PageUp</prev_track>
<next_track>PageDown</next_track>
<backspace>Back</backspace>
@b-alidra
b-alidra / mouse.xml
Created January 7, 2016 22:00
Minix A2 Lite mouse keycap for Kodi
<keymap>
<global>
<mouse>
<leftclick>Select</leftclick>
<rightclick>Back</rightclick>
<middleclick>noop</middleclick>
<doubleclick id="0">noop</doubleclick>
<longclick id="0">noop</longclick>
<wheeldown>noop</wheeldown>
<wheelup>noop</wheelup>
@b-alidra
b-alidra / le-renew.sh
Last active October 6, 2017 06:45 — forked from bmanojlovic/le-renew.sh
Auto renewal for Let's Encrypt Apache
#!/bin/bash
#================================================================
# Let's Encrypt renewal script for Apache on Ubuntu/Debian
# @author Erika Heidi<[email protected]>
# Usage: ./le-renew.sh [base-domain-name]
# More info: http://do.co/1mbVihI
#================================================================
domain=$1
le_path='/opt/letsencrypt'
le_conf='/etc/letsencrypt'
@b-alidra
b-alidra / lazy-loading-images.js
Last active March 31, 2016 14:50 — forked from bennadel/lazy-loading-images.htm
Lazy Loading Image With AngularJS
var app = angular.module( "Demo", [] );
app.directive(
"bnLazySrc",
function( $window, $document ) {
// I manage all the images that are currently being
// monitored on the page for lazy loading.
var lazyLoader = (function() {
// I maintain a list of images that lazy-loading
<?php
/**
* Remove the quoted parts from the message body.
*
* It actually handles:
* - Standard <blockquote>...</blockquote>
* - Google
* - Yahoo
* - Thunderbird
* - OSX Mail Client
<?php
$els_to_remove = [
'blockquote', // Standard quote block tag
'div.moz-cite-prefix', // Thunderbird
'div.gmail_extra', 'div.gmail_quote', // Gmail
'div.yahoo_quoted' // Yahoo
];
?>
@b-alidra
b-alidra / init_e3531.sh
Last active July 1, 2019 13:41
Send AT commands using atinout to Huawei E3531 modem after Kannel service has started
#/bin/sh
SERVICE=kannel
ATINOUT_BIN=/usr/bin/atinout
TTY=/dev/gsmmodem
while ! sudo systemctl is-active --quiet $SERVICE; do
echo "waiting the $SERVICE service to start"
sleep 10
done;