Skip to content

Instantly share code, notes, and snippets.

Nico Prat nicooprat

Block or report user

Report or block nicooprat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nicooprat
nicooprat / main.scss
Last active May 15, 2019
Sharing Tailwind config with SASS (Tailwind beta & Tailwind 1.0)
View main.scss
// Setting variables like this wouldn't be possible because SASS would
// get through this file before Tailwind does (because it's PostCSS)
$--color-primary: theme('colors.blue');
$--font-serif: theme('fontFamily.serif');
body {
color: rgba($--color-primary, .5);
font-family: $font-serif;
}
@nicooprat
nicooprat / nuxt.config.js
Created Dec 18, 2018
Nuxt, Webpack & Bugsnag
View nuxt.config.js
const { BugsnagBuildReporterPlugin, BugsnagSourceMapUploaderPlugin } = require('webpack-bugsnag-plugins')
module.exports = {
...
build: {
extend (config, { isDev, isClient }) {
if (!isDev && isClient) {
config.devtool = '#source-map'
config.plugins.push(
new BugsnagBuildReporterPlugin({
@nicooprat
nicooprat / custom-callback.php
Created Oct 22, 2018
Create an ACF block with Sage 9 & Blade
View custom-callback.php
function my_acf_block_render_callback( $block ) {
$slug = str_replace('acf/', '', $block['name']);
$block['slug'] = $slug;
$block['classes'] = implode(' ', [$block['slug'], $block['className'], $block['align']]);
echo \App\template("blocks/${slug}", ['block' => $block]);
}
@nicooprat
nicooprat / testimonial.php
Last active Oct 22, 2018
Custom Gutenberg bloc with bare PHP
View testimonial.php
<?php
/*
Title: Témoignage
Description: test
Category: formatting
Icon: admin-comments
Keywords: testimonial quote
*/
?>
@nicooprat
nicooprat / register-custom-blocks.php
Created Oct 22, 2018
Registering Gutenberg blocks with ACF blocks
View register-custom-blocks.php
function my_acf_block_render_callback( $block ) {
$slug = str_replace('acf/', '', $block['name']);
$block['slug'] = $slug;
$block['classes'] = implode(' ', [$block['slug'], $block['className'], $block['align']]);
echo \App\template("blocks/${slug}", ['block' => $block]);
}
add_action('acf/init', function() {
if( function_exists('acf_register_block') ) {
// Look into views/blocks
@nicooprat
nicooprat / testimonial.blade.php
Last active Apr 10, 2019
Custom Gutenberg bloc with Roots Sage & Blade
View testimonial.blade.php
{{--
Title: Témoignage
Description: test
Category: formatting
Icon: admin-comments
Keywords: testimonial quote
--}}
<blockquote data-{{$block['id']}} class="{{$block['classes']}}">
<p>{{the_field('testimonial')}}</p>
@nicooprat
nicooprat / custom-callback.php
Last active Oct 22, 2018
Create an ACF block
View custom-callback.php
function my_acf_block_render_callback( $block ) {
$slug = str_replace('acf/', '', $block['name']);
if( file_exists(STYLESHEETPATH . "/template-parts/block/content-{$slug}.php") ) {
include( STYLESHEETPATH . "/template-parts/block/content-{$slug}.php" );
}
}
View buddy.yml
- pipeline: "Push staging"
trigger_mode: "ON_EVERY_PUSH"
ref_name: "dev"
ref_type: "BRANCH"
target_site_url: ""
actions:
- action: "Composer"
type: "BUILD"
working_directory: ""
docker_image_name: "library/php"
@nicooprat
nicooprat / .gitignore
Created Mar 9, 2018
NPM scripts and environment variables
@nicooprat
nicooprat / .htaccess
Created Jul 17, 2017
W3 Total Cache conf
View .htaccess
# BEGIN W3TC Browser Cache
<IfModule mod_mime.c>
AddType text/css .css
AddType text/x-component .htc
AddType application/x-javascript .js
AddType application/javascript .js2
AddType text/javascript .js3
AddType text/x-js .js4
AddType text/html .html .htm
AddType text/richtext .rtf .rtx
You can’t perform that action at this time.