Skip to content

Instantly share code, notes, and snippets.

View mchelen's full-sized avatar

Mike Chelen (he/him) mchelen

View GitHub Profile
@mchelen
mchelen / index.php
Last active March 1, 2024 15:23
PHP SimpleXML Missing Node Test
<?php
/*
ways of checking if simplexml node exists:
isset()
count()
empty()
boolean
tested with PHP 5.5.23
@mchelen
mchelen / install-backport-iwlwifi-dkms.sh
Last active September 8, 2022 08:26
How to install Intel AX200 on Ubuntu 20.04 (tested with kernel 5.4.0-33-generic)
sudo apt install backport-iwlwifi-dkms
@mchelen
mchelen / index.php
Last active November 20, 2021 18:01
php check multidimensional array for duplicate values
<?php
$arrays = array(
array(
'name'=>'foo',
),
array(
'name'=>'bar',
),
array(
'name'=>'foo',
<?php
// assumes fieldName is a text field with 1 value
function FilterNodesByRegex($nids, $fieldName, $regex) {
$nodes = \Drupal::entityTypeManager()->getStorage('node')->loadMultiple($nids);
return array_filter($nodes, function($node) use ($regex, $fieldName) {
return preg_match(
$regex,
$node->get($fieldName)->getString()
);
@mchelen
mchelen / .gitignore
Last active October 28, 2020 14:32
Psr Logger Interface Type Hinting Monolog Dependency Injection Composer Example
vendor
composer.lock
example.log
➜ npm-script cat package.json
{
"name": "npm-script",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"echo": "source .env && echo $FOO"
},
"author": "",

Keybase proof

I hereby claim:

  • I am mchelen on github.
  • I am mchelen (https://keybase.io/mchelen) on keybase.
  • I have a public key ASDJLpuXNtVCcDhcu__HUqvkFkFgokGpGG6j4kVk0JcNIgo

To claim this, I am signing this object:

@mchelen
mchelen / .gitignore
Last active March 31, 2020 06:10
jsonresume registry server ubuntu 14.04
*~
registry-server/
.vagrant/
@mchelen
mchelen / README.md
Last active March 14, 2020 01:32
JSON Resume Browser Example