Skip to content

Instantly share code, notes, and snippets.

View jamiehollern's full-sized avatar

Jamie Hollern jamiehollern

  • Tag1 Consulting
  • Dùn Phris/Zürich
  • 08:45 (UTC)
View GitHub Profile
@shammelburg
shammelburg / auth-middleware.js
Last active December 8, 2021 17:13
express-graphql-api
const jwt = require('jsonwebtoken');
const authMiddleware = (req, res, next) => {
const authHeader = req.get('Authorization')
if (!authHeader) {
req.error = "No authentication header found."
req.isAuth = false
return next()
}
@bjo3rnf
bjo3rnf / example_form.html.twig
Last active November 14, 2023 08:52
Stimulus.js controller for Symfony collection form type with configurable item limit
{% macro collection_item(form) %}
<div data-form-collection-target="field">
{{ form_widget(form) }}
<button type="button"
data-action="form-collection#removeItem">
remove
</button>
</div>
{% endmacro %}
@colorfield
colorfield / standup.sh
Created October 8, 2020 19:54
Standup winner
#!/bin/bash
team=("Stephanie" "Dan" "Tish" "Alex" "Blazej" "John" "Mattia" "Christophe" "Maria" "Matt" "Gesche" "Lisa" "Dominic" "Nick" "Jamie" "Thomas" "Vasi" "Inky" "Chris" "Philipp" "Marco" "Beat")
suspense=("Picking" "🤔Changing" "😛Cheating")
RANDOM=$$$(date +%s)
# Get the winner
winner=${team[$RANDOM % ${#team[@]} ]}
# Produce some suspense
@tatianamac
tatianamac / tatiana-mac-speaker-rider.md
Last active March 24, 2024 12:22
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Last updated 14 April 2021

What is a speaker rider?

As speaking comes with immense privilege, I have crafted a speaker rider to set expectations and boundaries around my engagement. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most historically excluded and marginalised communities.

Considerations

😫 I provide a lot of explanations for those of you who never had to consider these things. Most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

@technology-amazeelabs
technology-amazeelabs / Drupal 8 Local Settings.md
Last active June 19, 2019 09:27
Drupal 8 local override for Settings and Services files

Add the following two files: settings.local.php and services.local.php to the web/sites/default/ folder within your Drupal 8 project to override settings such as enabling Twig debug and disabling cache.

Depending on the project, you may need to rename the files to local.settings.php and local.services.yml respectively.

@rhukster
rhukster / sphp.sh
Last active July 26, 2023 02:13
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@juampynr
juampynr / mymodule.info
Last active August 31, 2023 05:48
Drupal 7 Views 3 custom filter handler
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_filter_myfiltername.inc
@WengerK
WengerK / README.md
Last active August 20, 2019 09:08
Drupal 8 - Debugging Ajax Commands & Dialogs

Drupal 8 - Debugging Ajax Commands & Dialogs

'Cause it's nearly impossible to var_dump or dump into an Ajax Dialog or an Ajax Command, the most easier way is to write into the Apache logs.

To do this, just add the following snippet in your code:

error_log(var_export($var), TRUE);
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active March 26, 2024 10:34
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@webflo
webflo / drupal-finder.php
Created October 26, 2017 15:03
drupal-finder.php
<?php
// Usage: php drupal-finder.php /var/www/some/example/path
include __DIR__ . '/vendor/autoload.php';
$path = array_pop($argv);
$finder = new \DrupalFinder\DrupalFinder();
print "Input: " . $path . PHP_EOL;