Skip to content

Instantly share code, notes, and snippets.

View pixeline's full-sized avatar
😄
Heaven, I'm in heaven, And my heart beats so that I can hardly speak !

Alexandre Plennevaux pixeline

😄
Heaven, I'm in heaven, And my heart beats so that I can hardly speak !
View GitHub Profile
@pixeline
pixeline / pr.md
Last active October 31, 2025 00:09
Cursor command to create a PR . Save this file as `~/.cursor/commands/pr.md`. In Cursor, type `/pr` and follow the prompts.

Create PR (Good PR, Uses Template If Present)

Purpose: Create a high-quality Pull Request using the repo’s PR template if it exists; otherwise, generate a best-practice PR body with clear sections (Overview, Context, Changes, Tests, Screenshots, Risks, Rollback, Related Issues, Checklist). Assign reviewers, add labels, and link issues. Uses gh CLI.

Do exactly the following:

  1. Preconditions & tooling
    • Verify Git is available: git --version.
    • Verify GitHub CLI is available: gh --version.
  • Verify you’re authenticated with GitHub: gh auth status.
@pixeline
pixeline / commit.md
Last active October 29, 2025 18:40
Custom Cursor command: it creates one or more git commits for the current changes using the Conventional Commits specification. Save it in `~/.cursor/commands` and Cursor will automatically pick it up when you type "/commit" in the chat box.

Commit (Conventional Commits)

Purpose: Create one or more git commits for the current changes using Conventional Commits. First analyze and group related changes, then create focused commits for each group. Keep messages as short as possible and as long as necessary to be useful.

Do exactly the following:

  1. Check repo state
@pixeline
pixeline / cardano.15s.sh
Last active February 7, 2025 20:38
xbar plugin to display the value of Cardano in EUR, USD or JPY in a macos menu bar
#!/bin/bash
# <xbar.title>Cardano Price</xbar.title>
# <xbar.version>v1.0</xbar.version>
# <xbar.author>Alexandre Plennevaux</xbar.author>
# <xbar.author.github>pixeline</xbar.author.github>
# <xbar.desc>Displays Cardano (ADA) current price in EUR using CoinGecko API.</xbar.desc>
# <xbar.dependencies>curl, jq</xbar.dependencies>
# <xbar.var>select(VAR_CURRENCY="eur"): Which Currency? [usd, eur, jpy]</xbar.var>
@pixeline
pixeline / docker-compose.yml
Created June 3, 2022 08:56 — forked from ju2wheels/docker-compose.yml
docker-compose reference YAML file with comments
# https://docs.docker.com/compose/yml/
# Each service defined in docker-compose.yml must specify exactly one of
# image or build. Other keys are optional, and are analogous to their
# docker run command-line counterparts.
#
# As with docker run, options specified in the Dockerfile (e.g., CMD,
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to
# specify them again in docker-compose.yml.
#
service_name:
@pixeline
pixeline / create-hosting-user.sh
Created October 10, 2019 06:46
Create hosting user (Nginx).
#!/bin/bash
# Script automating the creation of a hosting account : the user, its folder, its virtualhost
: '
HOW-TO
$ bash /home/pixeline/bin/create-hosting-user username password domain.tld
Arguments:
- username (if not created, create it, otherwise use current) SEE https://gist.github.com/pixeline/9e5ea7d28e52138f0b31
- user password (for existing user, enter anything, it will not be used)
@pixeline
pixeline / virtualhost_le_template
Last active May 7, 2022 16:44
virtualhost Template (Nginx)
server {
root template.webroot;
server_name template.url;
index index.php index.html index.htm;
# HTTP Caching of static assets
location ~* \.(css|gif|jpg|js|png|ico|otf|sng|xls|doc|exe|jpeg|tgx)$ {
@pixeline
pixeline / React-learning-States-and-events.js
Created August 28, 2019 18:51
Pure React, Chapter 11: Exercise at the end of the chapter. Is this a proper react way to pass the ID to the state ?
const Room = ({onAction, room, children}) =>(
<button id={room} onClick={onAction} >{children}</button>
)
class House extends React.Component {
state = {
rooms: {
kitchen: true,
bathroom: false,
livingRoom: true,
@pixeline
pixeline / readme.md
Created June 1, 2019 11:52
Deploy a "docker-composed" environment on DigitalOcean

Deploy docker-compose on digitalocean

  1. create Docker droplet via digitalocean one-click-app-docker
  2. log into it
  3. generate SSH key
ssh-keygen -t rsa -N "" -f /root/.ssh/id_rsa
  1. Copy it
@pixeline
pixeline / function.remove_empty_html_tags.php
Last active April 28, 2019 13:35
PHP function removing all empty html nodes from a given html fragment. Useful for cleaning content entered via WYSIWYG editors.
<?php
function remove_empty_html_tags($html)
{
/**
* PHP function removing all empty html nodes from a given html fragment. Useful for cleaning content entered via WYSIWYG editors.
* source: https://stackoverflow.com/a/42067229/53960
* Regex by Mark Notton
*/
$regex = '~<((?!iframe|canvas)\w+)[^>]*>(?>[\p{Z}\p{C}]|<br\b[^>]*>|&(?:(?:nb|thin|zwnb|e[nm])sp|zwnj|#xfeff|#xa0|#160|#65279);|(?R))*</\1>~iu';
return preg_replace($regex, '', $html);
@pixeline
pixeline / CloseTheGap.md
Created June 5, 2018 12:37
closethegap

Aloha,

Je voudrais une chouette photo permettant de remercier close the gap de fournir tous les laptops gratuitement.

Pourriez vous prévoir cette semaine (peut être quand Charleroi vient ?) de réaliser ceci: Chaque écran de laptop qui affiche un "merci" en géant. Chaque apprenant peu choisir:

  • la langue du merci (chaque écran dans une autre langue)
  • couleur écriture et couleur fond
  • typographie et disposition (sens et rotation)