Skip to content

Instantly share code, notes, and snippets.

View nicooprat's full-sized avatar

Nico Prat nicooprat

View GitHub Profile
@nicooprat
nicooprat / **.tmTheme
Last active September 4, 2018 10:41
Highlight blocks of PHP in Sublime Text theme
<dict>
<key>name</key>
<string>Attributes</string>
<key>scope</key>
<string>meta.embedded.line.php, meta.embedded.block.php</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#FFFFFF0F</string>
</dict>
@nicooprat
nicooprat / README.md
Last active September 14, 2016 14:16
Trello custom theme
@nicooprat
nicooprat / README.md
Last active September 14, 2016 16:02
Atom theme

Atom theme, based on the default one.

Custom title bar activated (Mac OS only).

More infos here: atom/atom#10208

It's globally more compact (tabs, panes, ...) that the original one. It's made for an use of 1 pane or 2 panes horizontally split. Might have bugs in any other configuration.

Atom

@nicooprat
nicooprat / barba.js
Created February 4, 2017 10:13
Concept for Barba v2
// Internally, do something like this
Promise
.all([
this.loadNewContent,
this.transitionOut({
fromRoute,
event,
oldContainer,
promise
@nicooprat
nicooprat / blocks.php
Last active February 25, 2018 18:45
Simple PHP block yielding system
<?php
function block($slug, $params = array()) {
global $_SLUG_;
global $_PARAMS_;
$_SLUG_ = $slug;
$_PARAMS_ = $params;
ob_start();
@nicooprat
nicooprat / config-1.json
Created July 14, 2017 13:44
1. Config without French | 2. With French
{
"version": 8,
"id": "osm-liberty",
"name": "OSM Liberty",
"metadata": {
"mapbox:type": "template"
},
"sources": {
"natural_earth_shaded_relief": {
"maxzoom": 6,
@nicooprat
nicooprat / .htaccess
Created July 17, 2017 08:10
W3 Total Cache conf
# 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
@nicooprat
nicooprat / .gitignore
Created March 9, 2018 16:17
NPM scripts and environment variables
.npmrc
- 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 / custom-callback.php
Last active October 22, 2018 16:42
Create an ACF block
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" );
}
}