Skip to content

Instantly share code, notes, and snippets.

View jasloe's full-sized avatar
💭
I may be slow to respond.

Jason Loeffler jasloe

💭
I may be slow to respond.
View GitHub Profile
@StevenGFX
StevenGFX / twig-tweak.md
Last active September 27, 2023 16:11
Twig Tweak Cheat Sheet

View

This accepts views arguments as well:

{{ drupal_view('who_s_new', 'block_1') }}

View with multiple arguments:

{{ drupal_view('who_s_new', 'block_1' 'contextarg1', 'contextarg2', '...') }}

@steveruizok
steveruizok / animationSequence-example.ts
Created March 2, 2020 12:10
Framer Motion Animation Sequences
import * as React from "react"
import { Override, Data, AnimationControls, useAnimation } from "framer"
import { useAnimationSequence } from "./useAnimationSequence"
import { animationSequence } from "./animationSequence"
// Learn more: https://framer.com/docs/overrides/
let heart1: AnimationControls
let heart2: AnimationControls
let heart3: AnimationControls
@jasloe
jasloe / check-dram-marc-856u
Created May 20, 2019 17:22
Check DRAM MARC 856u
status url
301 https://www.dramonline.org/identifier/15053
301 https://www.dramonline.org/identifier/15389
301 https://www.dramonline.org/identifier/15547
301 https://www.dramonline.org/identifier/15884
301 https://www.dramonline.org/identifier/16859
301 https://www.dramonline.org/identifier/17243
301 https://www.dramonline.org/identifier/17345
301 https://www.dramonline.org/identifier/17348
301 https://www.dramonline.org/identifier/17349
@oliviercreurer
oliviercreurer / oblique_strategies.lua
Last active July 15, 2021 14:44
Oblique Strategies for Norns
-- OBLIQUE STRATEGIES
-- Brian Eno & Peter Schmidt
--
-- KEY 3 / Random strategy
-- KEY 2 / Random cutoff value
-- ENC 3 / Linear strategy scroll
-- ENC 1,2 / Clear screen
engine.name = 'PolyPerc'
@DSchau
DSchau / index.js
Created September 9, 2017 20:27
The GraphQL query showing how to format a date!
export const pageQuery = graphql`
query IndexQuery {
site {
siteMetadata {
title
author
}
}
allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }) {
edges {
@gaboratorium
gaboratorium / isIE.js
Created June 6, 2017 12:43
Detect IE with JavaScript #ie #edge #js #javascript
// Forked from https://codepen.io/gapcode/pen/vEJNZN
// Get IE or Edge browser version
var version = detectIE();
if (version === false) {
document.getElementById('result').innerHTML = '<s>IE/Edge</s>';
} else if (version >= 12) {
document.getElementById('result').innerHTML = 'Edge ' + version;
} else {
@jibran
jibran / FileEntity.php
Created March 24, 2017 00:39
Migrating Drupal 7 File Entities to Drupal 8 Media Entities
<?php
// modules/custom/my_custom_module/src/Plugin/migrate/source/FileEntity.php
namespace Drupal\my_custom_module\Plugin\migrate\source;
use Drupal\Core\Database\Query\Condition;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity;
/**
* Drupal 7 file_entity source from database.
@rocketeerbkw
rocketeerbkw / example.php
Last active June 23, 2023 18:42
How to migrate multi-value link field in Drupal 8
<?php
class Example extends SourcePluginBase {
public function prepareRow(Row $row) {
parent::prepareRow($row);
// I do some data manipulation to end up with an array that looks like this,
// which I want to import into multi-value link field.
$links = [
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@raphaellarrinaga
raphaellarrinaga / drupal_8_twig_cheatsheet.md
Last active July 20, 2023 21:21
[Drupal 8 Twig cheatsheet] #tags: drupal8, twig, cheatsheet

Drupal 8 Twig cheatsheet

Please note I created that sheet as a personal side note/draft and not everything is fully tested. There could be errors or better things to do. So if you spot something wrong or something that can be improved, feel free to comment below and I will do the changes.

Getting Drupal 8 field values in Twig

Image path: {{ file_url(content.field_name['#items'].entity.uri.value) }}