Skip to content

Instantly share code, notes, and snippets.

View abennouna's full-sized avatar

Abdelaziz Bennouna abennouna

View GitHub Profile
@abennouna
abennouna / add-all-icons-to-build.js
Last active February 15, 2019 09:34
Extract Ionicons used in Ionic4 app (use at your own risk)
'use strict';
const fs = require('fs');
const template = require(process.cwd() + '/bin/angular-template.json');
template.projects.app.architect.build.options.assets.push({
glob: '**/*.svg',
input: 'node_modules/ionicons/dist/ionicons/svg',
output: './svg',
});
@abennouna
abennouna / main-footer.component.ts
Created January 11, 2019 10:52
Position footer in real bottom of page if page long enough, or bottom of screen if page is short
@abennouna
abennouna / file-upload.ts
Last active July 23, 2017 08:24
File Upload using Angular
fileUpload(event) {
let fileList: FileList = event.target.files;
if (fileList.length > 0) {
let file: File = fileList[0];
const xhr: XMLHttpRequest = new XMLHttpRequest();
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
@abennouna
abennouna / gist:7248208
Last active December 27, 2015 01:49
Bidaya, votre site Web adaptatif et optimisé - Quatrième partie : optimisation de la performance Web - http://tellibus.com/blog/103
AddOutputFilterByType DEFLATE text/html
@abennouna
abennouna / gist:7045630
Last active December 25, 2015 21:49
Bidaya, votre site Web adaptatif et optimisé - Troisième partie : navigation améliorée en JavaScript - http://tellibus.com/blog/102
<?php
/* ************************************************************************** *\
* Code HTML et PHP du site monopage Bidaya *
* Billet de blog : http://tellibus.com/blog/102 *
* Démo : http://tellibus.com/bidaya/index-03.php *
* CC-BY-SA tellibus.com *
\* ************************************************************************** */
// DetectMobileBrowsers.com - Version du 09/09/2013
$userAgent = $_SERVER['HTTP_USER_AGENT'];
@abennouna
abennouna / gist:6938137
Last active December 25, 2015 07:19
Bidaya, votre site Web adaptatif et optimisé - Deuxième partie : RESS en PHP, HTML et CSS adaptatifs - http://tellibus.com/blog/101
<?php
/* ************************************************************************** *\
* Code HTML et PHP du site monopage Bidaya *
* Billet de blog : http://tellibus.com/blog/101 *
* Démo : http://tellibus.com/bidaya/index-02.php *
* CC-BY-SA tellibus.com *
\* ************************************************************************** */
// DetectMobileBrowsers.com - Version du 09/09/2013
$userAgent = $_SERVER['HTTP_USER_AGENT'];
@abennouna
abennouna / gist:5542558
Created May 8, 2013 18:37
Le Lab by tellibus : selectToAutocomplete - http://tellibus.com/lab/selectToAutocomplete
<link rel="stylesheet" href="jquery-ui.css" type="text/css">
<select id="SelectToAutoComplete">
</select>
<script src="jquery.min.js"></script>
<script src="jquery-ui-autocomplete.js"></script>
<script src="jquery.select-to-autocomplete.min.js"></script>
@abennouna
abennouna / gist:5542252
Last active December 17, 2015 03:19
Le Lab by tellibus : noUiSlider - http://tellibus.com/lab/noUiSlider
<link rel="stylesheet" href="nouislider.fox.css" type="text/css">
<div id="DivToTransform" class="noUiSlider horizontal"></div>
<div id="#Display"></div>
<script src="zepto.min.js"></script>
<script src="zepto.data.pack.js"></script>
<script src="nouislider.min.js"></script>
<script>
@abennouna
abennouna / gist:5541931
Last active December 17, 2015 03:19
Le Lab by tellibus : simplyScroll - http://tellibus.com/lab/simplyScroll
<link rel="stylesheet" href="jquery.simplyscroll.css" type="text/css">
<a href="#" id="goBack">Défiler vers l’arrière</a>
<a href="#" id="pause">Mettre en pause</a>
<a href="#" id="goFwd">Défiler vers l’avant</a>
<ul id="scroller">
</ul>
@abennouna
abennouna / gist:5540181
Last active December 17, 2015 02:59
Le Lab by tellibus : enscroll - http://tellibus.com/lab/enscroll
<div id="DivToScroll" style="height:300px;width:600px">
<!-- Il faut que le contenu de ce div soit relativement large et/ou haut pour le faire défiler -->
<div style="height:1000px;width:2000px"></div>
</div>
<script src="jquery.min.js"></script>
<script src="enscroll.pack.js"></script>
<script>
$(function($) {