Skip to content

Instantly share code, notes, and snippets.

View fugudesign's full-sized avatar

Vincent Lalanne fugudesign

View GitHub Profile
@fugudesign
fugudesign / README.md
Last active March 12, 2019 11:39
Recursively exclude __tests__ folders from Webstorm

Cdiscount exclude tests from searches in Webstorm

Open scopes preferences

File | Settings | Appearance and Behavior | Scopes for Windows and Linux

WebStorm | Preferences | Appearance and Behavior | Scopes for macOS

Add a custom scope

  • Click on + button
  • Set :
@fugudesign
fugudesign / react-native-yellowbox-off.js
Created February 26, 2019 15:36
Disable yellowbox on react-native
console.disableYellowBox = true;
@fugudesign
fugudesign / vince.zsh-theme
Created February 26, 2019 13:27
oh-my-zsh custom theme based on agnoster
# vim:ft=zsh ts=2 sw=2 sts=2
#
# Vince's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@fugudesign
fugudesign / wp-regex-original-medias.txt
Created May 22, 2018 21:44
Regex to match only Wordpress original images (no generated thumbnails)
^(?!.*-[0-9]{1,4}x[0-9]{1,4}).*\.(?:jpe?g|gif|png)$
@fugudesign
fugudesign / custom-gmap-shortcode.php
Last active May 18, 2018 14:42
Add a Wordpress shortcode to simply generate custom google maps without a plugin
<?php
/**
* Google Map Shortcode
* An optional separate file with custom styles can be loaded
* to declade the $gmapStyle variable contains the JSON as string
* change the path to match your config
*
* API KEY:
* You need to set your Google Maps API_KEY to the following constant
*
@fugudesign
fugudesign / grayscale.php
Last active April 27, 2018 17:06
Wordpress attachment images: generate a grayscale copy of main (full) image referenced as an image_size
/**
* Generate a grayscale copy of main (full) image referenced as an image_size
*/
function add_grayscale_image_size( $image_sizes ) {
$image_sizes[] = 'grayscale';
return $image_sizes;
}
@fugudesign
fugudesign / git pull with submodules
Created April 3, 2018 21:14
Git config alias for update repo and submodules
git config --global alias.update '!git pull && git submodule update --init --recursive --remote'
@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 <[email protected]>
*
*
* Step 1: create the SSH key on your hosting
* https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2
@fugudesign
fugudesign / simple-image-api.php
Last active February 13, 2018 11:19
Simple images API PHP
<?php
/*
JSON list of all images files in current directory
*/
header("Access-Control-Allow-Origin: *");
$dir = ".";
$dh = opendir($dir);
$image_files = array();
@fugudesign
fugudesign / Wordpress PO settings
Last active January 24, 2018 15:40
Wordpress PO settings
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
"_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
"esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SourceCharset: UTF-8\n"
"Plural-Forms: nplurals=2; plural=(n>1);\n"
"X-Poedit-SearchPath-0: ..\n"