Skip to content

Instantly share code, notes, and snippets.

View gostrafx's full-sized avatar

GOSTRA FX gostrafx

View GitHub Profile
@gostrafx
gostrafx / gulpfile.js
Last active May 19, 2019 22:18
gulpfile
"use strict";
const {src, dest, watch, series, parallel, lastRun} = require('gulp');
const del = require('del');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const concat = require('gulp-concat');
const browserSync = require('browser-sync');
const uglify = require('gulp-uglify');
const postcss = require('gulp-postcss');
@gostrafx
gostrafx / EditorConfig.md
Last active July 30, 2019 20:48
Editing Projects Using EditorConfig
@gostrafx
gostrafx / Socket php.md
Last active May 19, 2019 22:19
Socket php

Crée un point de communication et le retourne sous forme de ressource

socket_create	    

Permet de se connecter à une socket existante

socket_connect	
@gostrafx
gostrafx / Header php.md
Last active May 19, 2019 22:18
Header php
<?php

// Utilisez cette tête instruction pour corriger 404 têtes
// Produit par url rewriting ...
header('HTTP/1.1 200 OK');

// Page n'a pas été trouvé:
header('HTTP/1.1 404 Not Found');
@gostrafx
gostrafx / Table PHP.md
Last active May 19, 2019 22:18
Table PHP
<?php

<!-- Mon tableau -->

$retour = "<br />";
$prenom="John";//string
echo $prenom;
echo gettype($prenom);
echo $retour;
@gostrafx
gostrafx / curl_php.md
Last active February 23, 2021 14:44
Curl php
<?php

$options = array (
CURLOPT_RETURNTRANSFER => true, // pour revenir page Web
CURLOPT_HEADER => false, // pour revenir en-têtes en plus de contenu
CURLOPT_FOLLOWLOCATION => true, // de suivre les redirections
CURLOPT_ENCODING => "", // pour gérer tous les encodages
CURLOPT_AUTOREFERER => true, // de mettre en referer sur redirection
CURLOPT_CONNECTTIMEOUT => 5, // définir un délai à la connexion
@gostrafx
gostrafx / Vim cheat sheet.md
Last active May 19, 2019 22:17
Vim cheat sheet

A highly opinionated vim cheat sheet.

Copy / Cut / Paste (normal mode)

  • selecting:
    • v: start selecting characters
    • V: selects the whole line
  • action:
    • d: to cut
  • y: to copy
@gostrafx
gostrafx / Javascript Fetch.md
Created May 19, 2019 22:20
Javascript Fetch

Fetch

fetch('/data.json')
  .then(response => response.json())
  .then(data => {
    console.log(data)
  })
  .catch(err => ...)
  • gulp-ruby-sass
  • gulp-autoprefixer
  • gulp-minify-css
  • gulp-jshint
  • gulp-concat
  • gulp-uglify
  • gulp-imagemin
  • gulp-livereload (requires tiny-lr)
  • gulp-clean
  • gulp-cache
@gostrafx
gostrafx / Javascript Promises.md
Created May 19, 2019 22:21
Javascript Promises

Based on the [Promise API reference][promise] (mozilla.org).

promise

Creating promises

new Promise(function (ok, err) {
 doStuff(function () {