Skip to content

Instantly share code, notes, and snippets.

View fugudesign's full-sized avatar

Vincent Lalanne fugudesign

View GitHub Profile
@rphlmr
rphlmr / app-install-manager.tsx
Created October 21, 2023 16:13
PWA App install button handling native prompt or a fallback.
/**
* App Install Manager
*
* Author: @rphlmr
*/
/**
* You will be surprised by the code below.
*
* `beforeinstallprompt` is an event really hard to work with 😵‍💫
@fugudesign
fugudesign / gitploy.php
Last active May 29, 2018 17:36
PHP script to automatically deploy from github webhooks
<?php
/**
*
* AUTODEPLOY GITHUB REPO ON HOSTING
*
* @author Vincent Lalanne <info@fugu.fr>
*
*
* Step 1: create the SSH key on your hosting
* https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2
@caedes
caedes / cloudSettings
Created January 30, 2018 07:58
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-01-30T07:57:00.805Z","extensionVersion":"v2.8.7"}

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step).

    git clone git@github...some-repo.git
@Golgarud
Golgarud / deployment.php
Last active February 19, 2018 15:24
deployment.php
<?php
if ( !isset( $_GET["tkn"] ) || $_GET["tkn"] !== "MonSuperToken" )
{
header('HTTP/1.0 403 Forbidden');
echo "<h1>Nope :D</h1>";
die();
}
/**
* GIT DEPLOYMENT SCRIPT
@rewop
rewop / Challenge.md
Last active August 5, 2018 21:07 — forked from dseelmann/.eslintrc
Test task

Task

Implement a page with a multi-step form, where each step shows when you have completed the previous one. In other words, we're not looking for previous/next buttons, but the next step should appear automatically.

Steps

  1. Two checkboxes with labels A1 and A2. Both are unchecked by default. Next step is available after at least one of them is checked.
  2. Two toggle buttons with labels B1 and B2. One button untoggles another (same as radio buttons behavior). Both are inactive by default. Next step is available when any option has been chosen.
  3. Text field with button Check. When button is pressed a value of the field will be send. Next step is available if a response from API is fine.
  4. Selectbox with C1, C2, C3 options. It is empty by default. Next step is available when any option has been chosen.
@fugudesign
fugudesign / Wordpress activate link manager.php
Created November 15, 2016 13:19
Code for activating the native link manager of Wordpress, with link categories and links widget.
@fugudesign
fugudesign / Wordpress clean <head>
Last active November 15, 2016 13:23
Wordpress remove unnecessary code from <head>
// Remove unnecessary code from header
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link');
remove_action( 'wp_head', 'wp_shortlink_wp_head');
// and also for WPML
global $sitepress;
remove_action( 'wp_head', array( $sitepress, 'meta_generator_tag' ) );
@fugudesign
fugudesign / Wordpress disable adminbar
Last active November 15, 2016 13:23
Wordpress disable adminbar on front
// Disable the adminbar for the frontend
add_filter('show_admin_bar', '__return_false');
@fugudesign
fugudesign / Wordpress disable emoji
Last active November 15, 2016 13:23
Wordpress disable emoji ability
/**
* Disable the emoji ability added from WP 4.2
*/
function my_disable_wp_emojicons() {
// all actions related to emojis
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );