Skip to content

Instantly share code, notes, and snippets.

@stefthoen
stefthoen / getComponents.php
Last active December 18, 2023 12:39
Get files from directory using RecursiveDirectoryIterator
<?php
$dirs = get_directories('components');
Timber::$dirname = array_merge(add_components_dir($dirs), ['views', 'svgs']);
function get_directories($componentsDir)
{
$dir = get_template_directory() . '/' . $componentsDir;
$dirIterator = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);
@stefthoen
stefthoen / update-trellis.md
Last active March 24, 2021 13:29
Update Trellis

https://discourse.roots.io/t/lets-encrypt-certificate-expired/7171/3

It might be fastest to back up your database and uploads and try reprovisioning your server with a fresh copy of Trellis (and all your configs, of course).

Here’s a quick overview of how I update Trellis. There are better ways but this is fast:

Copy the following out of your Trellis directory:

.vault_pass
@stefthoen
stefthoen / gist:6acddc16f555860a215b8148a2789eed
Created June 13, 2020 16:07
Mount Time Capsule in Ubuntu
Long story short, i needed to mount my time capsule in linux (and use it) and since i did not find anywhere "easy" solution - here's one (full R/W access):
sudo mount.cifs //TC_ADDRESS/NAME_OF_YOUR_SHARE /mnt/YOUR_DESTINATION_DIRECTORY -o user=USERNAME,sec=ntlm,vers=1.0,gid=$(id -g),uid=$(id -u),forceuid,forcegid
* after username you can add pass=YOUR_PASSWORD (in case you are too lazy to type it in every time you mount it).
{
"basics": {
"name": "Stef Thoen",
"label": "Web Developer",
"summary": "I’m a full stack web developer who can build apps from the ground up. I've worked mostly as a freelancer so I am used to wearing many hats. I have a lot of experience working with distributed teams.",
"website": "https://stef.co",
"email": "[email protected]",
"location": {
"city": "Cussy-en-Morvan",
"countryCode": "FR"
@stefthoen
stefthoen / git-tag-delete-local-and-remote.sh
Created May 7, 2020 10:02 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
import { series, parallel, src, dest, watch } from "gulp";
import babel from "gulp-babel";
import yargs from "yargs";
import gulpif from "gulp-if";
import webpack from "webpack-stream";
const production = yargs.argv.prod;
const basePath = "../";
.o-grid {
width: 100%;
display: flex;
flex-wrap: wrap;
@supports (display: grid) {
display: grid;
grid-column-gap: var(--space-default);
grid-row-gap: var(--space-default);
}
@stefthoen
stefthoen / grid.scss
Created May 22, 2018 16:56
SCSS Grid
/*------------------------------------*\
#COMPONENTS-GRID
\*------------------------------------*/
.c-grid {
position: relative;
width: 100%;
display: grid;
grid-column-gap: $space-default;
<?php
namespace CoenJacobs\StefExample\PostTypes;
abstract class AbstractType {
public function setup() {
// possibly some setup logic here?
}
public function register() {
@stefthoen
stefthoen / lost-grid.html
Last active March 2, 2017 12:53
Lost Grid can't deal with columns of different sizes.
<!-- Problem is that the first div with the .half class will float to the right. Is there
some way that I can make sure that the div with the .full class will take up the whole
row and the first div with the .half class will float left? -->
<style>
.container {
lost-utility: clearfix;
}
.full {
lost-column: 1;