Skip to content

Instantly share code, notes, and snippets.

@d3v2a
d3v2a / readme.md
Last active May 30, 2024 18:11
Reload dolibarr module from cli

Files should be in custom folder

reload.sh search for class name given in the module path

./reload.sh modulepah [0|1]

reload module with module class name (eg: modFacture)

@d3v2a
d3v2a / ZLinky_TIC.js
Last active November 15, 2021 16:37
zigbee2mqtt ZLinky TIC
const fz = require("zigbee-herdsman-converters/converters/fromZigbee");
const exposes = require("zigbee-herdsman-converters/lib/exposes");
const constants = require("zigbee-herdsman-converters/lib/constants");
const e = exposes.presets;
const ea = exposes.access;
let option_standard = () => exposes.binary(`standard`, ea.SET, true, false).withDescription(`Compteur avec la TIC en mode standard`)
let option_triphase = () => exposes.binary(`triphase`, ea.SET, true, false).withDescription(`Compteur triphase`)
let option_production = () => exposes.binary(`production`, ea.SET, true, false).withDescription(`Compteur avec de la production`)
@d3v2a
d3v2a / FirstModel.php
Created October 28, 2016 01:09
bug with phpunit
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class FirstModel extends Model
{
protected $table = 'FirstModels';
@d3v2a
d3v2a / update_env.php
Created September 26, 2016 13:21
update env file with php
$key = $argv[1];
$value = $argv[2];
$path = dirname(__FILE__) . '/.env';
$newContent = '';
$content = fopen($path, 'r+');
$found = false;
while (!feof($content)) {
$line = fgets($content);
if (!empty(trim($line))) {
@d3v2a
d3v2a / glupfile.js
Last active September 26, 2016 12:55
Elixir minify each file by folder with watch (not concat)
var elixir = require('laravel-elixir');
var gulp = require('gulp');
var Task = elixir.Task;
var uglify = require('gulp-uglify');
elixir.extend('folder', function (folder, dest) {
if (!dest) {
dest = folder;
}
new Task('folder', function () {
@d3v2a
d3v2a / perm.php
Created November 26, 2015 22:29
search in user permision dolibarr
<?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@d3v2a
d3v2a / card.php
Created September 8, 2015 21:02
tva card
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
@d3v2a
d3v2a / difflang.php
Created July 21, 2015 15:20
get diff in hesk language file
<?php
//put this file in the root of language folder
define('IN_SCRIPT',1);
include 'en/text.php';
$en_langs = $hesklang;
$hesklang = null;
include 'fr/text.php';
print 'non trouv&eacute; dans en';
$infr = array_diff_key($hesklang, $en_langs);
print '<pre>';