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 / 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)

JS Frameworks : ReactJS

Il y a le backend, il y a le frontend... Et il y a les frameworks Javascript tels que Angular (made in Google), Vue.js (opensource) et React (Made in Facebook).

A priori, ce sont d'abord des outils pour faire du frontend, mais avec la particularité que vous pouvez manipuler des services de données externes (tels que Firebase ou AWS) directement depuis votre code frontend. Des bâtards, quoi.

Quel est leur intérêt ?

Ils sont particulièrement indiqués pour les applications web et les interfaces très réactives, plus que pour les simples sites vitrines (où l'utilisateur va surtout lire).

Discussion sur les tarifs/salaires:

résumé d'une discussion chez BeCode/Lovelace2 (animée par Juan et Alex).

Les questions

  • Comment savoir combien je vais gagner en tant qu’employé?
  • Comment négocier mon contrat/salaire?
  • En tant qu’indépendant, combien demander pour la réalisation d’un site?

Les infos récoltées

@pixeline
pixeline / basic_sass_features.md
Last active August 28, 2019 11:12 — forked from blackfalcon/basic_sass_features.md
Exercises in basic Sass features

Sass is a powerhouse language that is adding new features all the time. For this introduction we will go over the basics of the language and see how they all tie together. We will discuss nesting, parent selector definitions, variables, Sass math, @extends, and @mixins.

Code comments

Commenting your code is the number one awesome thing any developer can do. In CSS you can place comments in your code /* */, but this will appear in the actual CSS and sometimes you don't want or need all that stuff to be there.

In Sass comments are highly encouraged. Sass has what are called 'silent comments' using the // syntax. This will allow the developer to comment like crazy and none of this is exposed in the final CSS. An interesting feature is that Sass supports both types of comments.

Scss