Skip to content

Instantly share code, notes, and snippets.

View GiorgosK's full-sized avatar

Giorgos Kontopoulos GiorgosK

View GitHub Profile
@swyxio
swyxio / readme.md
Last active May 11, 2022 07:58
notes on how to video tutorial like a pro - https://www.youtube.com/watch?v=9lPjY-JGZDY

Notes for gregg pollack's https://www.youtube.com/watch?v=9lPjY-JGZDY

Tools: AUDIO > Video. Use a good mic. Film yourself w/ natural light & good backdrop when explaining ideas. Use Screenflow, high res monitor (for zooming). Hire a film editor. Keynote/powerpoint. Use Animations! Get everything captioned!

Instructional Design:

  • Describe the problem first, dont just teach syntax.
  • Give Learning Objectives.
  • Show them what you're going to build, what they need to know
  • teach with visuals where needed
  • Show more than one example
@swyxio
swyxio / readme.md
Last active January 16, 2022 10:36
svelte society day talks and resources -
@knutholst
knutholst / did.sh
Last active February 4, 2019 06:12
DID
#!/bin/bash
# What did i do today?
# from https://theptrk.com/2018/07/11/did-txt-file/
# original from https://gist.github.com/alexisjanvier/bfe71d18f68434e29c08637e4d837c74
export MDV_THEME=729.8953
export DID_PATH=~/.did
function did(){
export LC_ALL=C
@idiazroncero
idiazroncero / container.html.twig
Last active April 27, 2024 22:32
Drupal 8 // removes the [opinionated: unnecesary] class 'views-element-container' from rendered views.
{#
/**
* @file
* Theme override of a container used to wrap child elements.
*
* Used for grouped form items. Can also be used as a theme wrapper for any
* renderable element, to surround it with a <div> and HTML attributes.
* See \Drupal\Core\Render\Element\RenderElement for more
* information on the #theme_wrappers render array property, and
* \Drupal\Core\Render\Element\container for usage of the container render
@NodarDavituri
NodarDavituri / TwigExtension.php
Last active July 20, 2018 08:16
Custom Twig Extension Sample for Drupal 8
<?php
/* acme_twig_helpers/src/TwigExtension.php */
namespace Drupal\acme_twig_helpers;
use Drupal\Component\Utility\Html;
use Drupal\taxonomy\Entity\Term;
use Twig_Extension;
use Twig_SimpleFunction;
@ValeriiVasyliev
ValeriiVasyliev / drupal8-change-view-field-value.md
Created August 19, 2017 08:41
Drupal 8. Change View Field Value

Method 1

/**
 * Implements hook_views_pre_render().
 */
function hook_views_pre_render(&$view) {
  if ($view->name == 'myview') {
    foreach ($view->result as &$row) {
 $row-&gt;field_myfield[0]['rendered']['#markup'] = $row-&gt;field_myfield[0]['rendered']['#markup'] ? t('Yes') : t('No');
{% set image_file_path = content.field_teaser_image[0]['#media'].field_media_image.entity.uri.value %}
{% set image_file_alt = content.field_teaser_image[0]['#media'].field_media_image.0.alt %}
<div class="teaser__image">
{% if node.field_teaser_image_style.value == 'portrait' %}
<a href="{{ url }}">
<img src="{{ image_file_path | image_style('portrait_teaser') }}" alt="{{ image_file_alt }}">
</a>
{% endif %}
@sloanlance
sloanlance / git-temporary-ignore.md
Last active March 2, 2024 01:32
git: A couple ways to temporarily ignore changed or new files without altering .gitignore.

There are times notifications aren't wanted about either a changed repo file or a new file that needs to be added to the repo. However, adding the name of the file to .gitignore might not be a good option, either. For example, locally-generated files that other users aren't likely to generate (e.g., files created by an editor) or files of experimental test code might not be appropriate to appear in a .gitignore file.

In those cases, use one of these solutions:

  1. If the file is a changed repo file

    Use the command:

    git update-index --assume-unchanged "$FILE"

@crittermike
crittermike / get_node_by_path.php
Created September 16, 2016 15:15 — forked from thagler/get_node_by_path.php
Drupal 8 Get node ID by path alias
<?php
$path = \Drupal::service('path.alias_manager')->getPathByAlias('/this-is-the-alias');
if(preg_match('/node\/(\d+)/', $path, $matches)) {
$node = \Drupal\node\Entity\Node::load($matches[1]);
}
<?php
/**
* A simple fix for a shell execution on preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version);
* The only edit that was done is that shell_exec('mysql -V') was changed to mysql_get_server_info() because not all
* systems have shell access. XAMPP, WAMP, or any Windows system might not have this type of access. mysql_get_server_info()
* is easier to use because it pulls the MySQL version from phpinfo() and is compatible with all Operating Systems.
* @link http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento
* @author Magento Inc.
*/