Skip to content

Instantly share code, notes, and snippets.

View kgaut's full-sized avatar

Kevin Gautreau kgaut

View GitHub Profile
@bdlangton
bdlangton / Blocks.md
Last active October 12, 2023 08:40
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');
<?php
/**
* This plugin creates a new paragraph entity based on the source.
*
* @MigrateProcessPlugin(
* id = "mds_paragraph"
* )
*/
class ParagraphMigrateProcessor extends ParagraphProcessBase {

#Configurer son éditeur Atom comme Sublime Text

##Disclaimer Je suis graphiste donc j'ai juste besoin d'un éditeur de texte simple pour faire un peu de PHP et de HTML vite fait, qui soit pratique et qui soit surtout JOLI (oui ça compte). Donc si vous êtes un(e) dev bien véner, je ne doute pas que votre super IDE-de-la-mort calibré au millipoil sera mieux que ce dont je parle ici. Peut être qu'on peu faire tout ça avec d'autres IDE aussi mais c'est pas la question.

##Pourquoi Sublime Text ? Quand un pote m'a montré sublime text, le premier truc frappant c'est qu'il était JOLI, surtout avec le thème monokai. Ensuite il était pratique, avec une fonctionnalité inédite (pour moi à l'époque) le multi curseur et la multiple sélection du même mot (ça existait surement ailleurs mais je ne connaissais pas) Il y avait une fonctionnalité de minimap cool et un super panneau de commande activable avec ctrl+shift+p.

Problème : il était payant, et pas donné quand son métier n'est pas de coder (70€ il me semble) un version

@jmolivas
jmolivas / composer.json
Created February 2, 2016 16:12
DrupalComposer + post-install
{
"name": "drupal-composer/drupal-project",
"description": "Project template for Drupal 8 projects with composer",
"type": "project",
"license": "GPL-2.0+",
"authors": [
{
"name": "",
"role": ""
}
@jmolivas
jmolivas / post-install.yml
Last active February 2, 2016 16:17
Drupal Composer + post-install.yml and post-update.yml examples
commands:
# Install Drupal
- command: site:install
options:
langcode: en
db-type: mysql
db-host: 127.0.0.1
db-name: drupal_composer
db-user: root
db-pass: root # local config
@davidhund
davidhund / pragmatic-touch-icons.md
Last active September 4, 2020 15:42
Pragmatic Touch Icons

NOTE I'm trying to find the most optimal fav/touch icon setup for my use-cases. Nothing new here. Read Mathias Bynens' articles on re-shortcut-icon and touch icons, a FAQ or a Cheat Sheet for all the details.

I'd like to hear how you approach this: @valuedstandards or comment on this gist.

The issue

You have to include a boatload of link elements pointing to many different images to provide (mobile) devices with a 'favicon' or 'touch icon':

![Touch Icon Links](https://o.twimg.com/2/proxy.jpg?t=HBj6AWh0dHBzOi8vcGhvdG9zLTYuZHJvcGJveC5jb20vdC8yL0FBRGFGY1VRN1dfSExnT3cwR1VhUmtaUWRFcWhxSDVGRjNMdXFfbHRJWG1GNFEvMTIvMjI3OTE2L3BuZy8xMDI0eDc2OC8yL18vMC80L1NjcmVlbnNob3QlMjAyMDE1LTA0LTE0JTIwMTYuNTYuMjYucG5nL0NNejBEU0FCSUFJZ0F5Z0JLQUkvNGR1eDZnMzZmYnlzYWI3

@jmiserez
jmiserez / export_google_music.js
Last active December 20, 2023 01:45
(fixed/updated 2016-05-10) Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Copyright 2016 Jeremie Miserez <jeremie@miserez.org>
//
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O
@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@Paulmicha
Paulmicha / drush_cs.sh
Last active July 5, 2018 09:17
Drush - usual commands cheatsheet
#!/bin/bash
# -*- coding: UTF8 -*-
##
# Drush usual commands cheat sheet
# Prerequisites : drush installed
#
# Sources:
# http://drushcommands.com/
# http://highrockmedia.com/blog/features-drush-drupal-goodness