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 / .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 / SessionBuilder.php
Last active March 2, 2018 12:41
Pomm auto tagging model & model layer, use custom session builder for query logs
<?php
namespace App\Model;
use PommProject\Foundation\Converter\ConverterHolder;
use PommProject\Foundation\Session\Session;
use PommProject\ModelManager\SessionBuilder as ModelManagerSessionBuilder;
/**
* Class SessionBuilder
*
@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 / userChrome.css
Created December 9, 2017 10:51
Firefox Quantum personal toolbar
/* in windows (may need to create the chrome folder) : %APP_DATA% Roaming\Mozilla\Firefox\Profiles\xxxxxxx.default\chrome */
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Center the personal toolbar items */
#PlacesToolbarItems {
-moz-box-pack: center
}
/* Padding Adjustements */
@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