Skip to content

Instantly share code, notes, and snippets.

View lossendae's full-sized avatar

Stéphane Boulard lossendae

View GitHub Profile
@lossendae
lossendae / DashboardApp.vue
Created December 11, 2022 19:05 — forked from alOneh/DashboardApp.vue
Example of a Vue.js app integrated in a twig template
<template>
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-green"><i class="fa fa-users"/></span>
<div class="info-box-content">
<span class="info-box-text">Active users</span>
<span class="info-box-number">{{ usersCount || 0 }}</span>
</div>
</div>
@lossendae
lossendae / Makefile
Created December 25, 2019 01:45 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@lossendae
lossendae / stringUtils.js
Created May 30, 2018 21:15 — forked from cvergne/stringUtils.js
Little javascript method to get initials from a name
String.prototype.getInitials = function(glue){
if (typeof glue == "undefined") {
var glue = true;
}
var initials = this.replace(/[^a-zA-Z- ]/g, "").match(/\b\w/g);
if (glue) {
return initials.join('');
}
@lossendae
lossendae / monolog-pimple-whoops-examples.php
Created March 16, 2018 13:58 — forked from kafene/monolog-pimple-whoops-examples.php
Set up some Monolog handlers, a Pimple Container, and Whoops
<?php
/**
* Various configurations of Monolog and Whoops
* using a Pimple Container as service locator
*
* Monolog: https://github.com/Seldaek/monolog
* Pimple: https://github.com/fabpot/Pimple
* Whoops: https://github.com/filp/whoops
* Swift Mailer: https://github.com/swiftmailer/swiftmailer
@lossendae
lossendae / task.rb
Created February 15, 2018 20:58 — forked from povodok/task.rb
require 'uri'
require 'net/http'
require 'json'
class UpdatesIssuesNotifierListener < Redmine::Hook::Listener
CALLBACK_URL = 'https://localhost:3333'.freeze
def controller_issues_edit_after_save(context)
data = {
'issueid' => context[:issue].id,
@lossendae
lossendae / git-tag-delete-local-and-remote.sh
Created July 5, 2017 13:33 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@lossendae
lossendae / powerline_setup.sh
Created December 21, 2016 07:34 — forked from cheuerde/powerline_setup.sh
Powerline on Debian and Centos for BASH, VIM and TMUX
# Claas Heuer, November 2015
#
# Setup Powerline on Debian and Centos for BASH, VIM and TMUX
# source: https://fedoramagazine.org/add-power-terminal-powerline/
# install on debian
sudo apt-get install python-pip
sudo apt-get install powerline
@lossendae
lossendae / transport.menu.php
Last active October 3, 2015 08:58 — forked from splittingred/transport.menu.php
MODX menu transport file (for MODX 2.3)
<?php
/* will route to the first found of the following:
[namespace-path]controllers/[manager-theme]/index.class.php
[namespace-path]controllers/default/index.class.php
[namespace-path]controllers/index.class.php
*/
$menu= $modx->newObject('modMenu');
$menu->fromArray(array(
'text' => 'mycomponent',
@lossendae
lossendae / test-speed.php
Created March 1, 2012 21:36 — forked from opengeek/test-speed.php
Simple benchmark for iterative MODX Chunk parsing
<?php
include 'config.core.php';
include MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('web');
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
$modx->setLogLevel(xPDO::LOG_LEVEL_INFO);
$tstart = $modx->getMicroTime();