Skip to content

Instantly share code, notes, and snippets.

View lossendae's full-sized avatar

Stéphane Boulard lossendae

View GitHub Profile
@lossendae
lossendae / instruction.md
Created September 18, 2023 10:55
Allow Cypress to run chrome installed via flatpak

Create a file in your home and make it executable:

sudo vi ~/.local/bin/chrome
sudo chmod +x ~/.local/bin/chrome

Content of the file :

@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 / reset.sh
Last active April 19, 2021 18:11
Git reset status for file marked as changed but with no content modification (mostly due to file permission change)
#!/usr/bin/env bash
set -e
git status --porcelain | (
unset action
while read line; do
case "${line//[[:space:]]/}" in
'UU'*) action='check' ;;
'M'*) action='check' ;;
'D'*) action='ignore' ;;
@lossendae
lossendae / merge_json.sql
Last active March 29, 2021 12:54
Various POSTGRESQL helpers
with
test as (
select *
from (
values
(123, '{"key_1": {"value_1": 1}}'::jsonb),
(123, '{"key_2": {"value_2": 2}}'::jsonb),
(123, '{"key_3": {"value_3": 3}}'::jsonb),
(456, '{"key_4": {"value_4": 4}}'::jsonb),
(456, '{"key_1": {"value_3": 4}}'::jsonb)
@lossendae
lossendae / bash.sh
Last active July 27, 2020 10:02
Misc bash things
#!/bin/bash
set -e
function travel() {
cd /var/www/$1 ${@:2} && echo -ne "\033]0;${1}\007"
}
dps() {
docker ps $@
}
@lossendae
lossendae / jetbrains-phpstorm.desktop
Created March 25, 2020 19:52
PHPStorm Menu (in order to have node loaded) in ~/.local/share/applications/
[Desktop Entry]
Exec=/bin/bash -i -c "/path/to/bin/phpstorm.sh" %f
... or
Exec=/bin/zsh -i -c "/path/to/bin/phpstorm.sh" %f
...
@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 / .powerlinerc
Last active June 28, 2018 06:21
ZSH config
# General config
POWERLEVEL9K_MODE='nerdfont-fontconfig'
POWERLEVEL9K_INSTALLATION_PATH=$ANTIGEN_BUNDLES/bhilburn/powerlevel9k
# prompt
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status dir_writable time)
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator user dir vcs)
# other options
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
@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