Skip to content

Instantly share code, notes, and snippets.

View glenux's full-sized avatar
Being happy

Glenn Y. Rolland glenux

Being happy
View GitHub Profile
#!/usr/bin/env python
import sys
from PySide2.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout
from PySide2.QtGui import Qt
class HelloApplication(QApplication):
def __init__(self, args):
QApplication.__init__(self, args)
var gulp = require('gulp');
var ts = require('gulp-typescript');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var tsify = require('tsify');
/* for NODE */
/* gulp.task('default', function() {
@glenux
glenux / dotenv.php
Last active October 10, 2018 10:40
Helper for PHP sites hosted on servers where environement variables are disabled in apache .htaccess (making mod_env and SetEnv useless)
<?php
// dotenv.php
// A helper script for PHP sites hosted on servers where environement variables
// are disabled in apache .htaccess (making mod_env and SetEnv useless)
// URL: https://gist.github.com/glenux/a727a02614b2d37a963967d1b6759073
function dotenv_file() {
$dotenv = null;
#!/bin/sh
set -e
set -u
INPUT="${1:-}"
OUTPUT="${2:-}"
if [ -z "$INPUT" ]; then
echo "ERROR: please give a input file name"
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
#!/bin/bash
org="$(git remote get-url origin |awk -F/ '{ print $4; }')"
project="$(basename "$(git rev-parse --show-toplevel)")"
branch=$(git rev-parse --abbrev-ref HEAD)
url="https://bitbucket.org/${org}/${project}/pull-request/new?source=${branch}&t=1"
xdg-open "$url"
#!/bin/bash
org="$(git remote get-url origin |awk -F/ '{ print $4; }')"
project="$(basename "$(git rev-parse --show-toplevel)")"
branch=$(git rev-parse --abbrev-ref HEAD)
url="https://bitbucket.org/${org}/${project}/pull-request/new?source=${branch}&t=1"
xdg-open "$url"
/*
Exercice - prixttc (10 min)
===========================
A. Ecrire une fonction 'prixTTC' qui:
- prend un parametre numérique (prix_ht)
- calcule le prix TTC (rappel: la TVA est de 20%)
- retourne le prix TTC.
B. Vérifier votre fonction avec le programme suivant :