Skip to content

Instantly share code, notes, and snippets.

View hphoeksma's full-sized avatar

Henjo Hoeksma hphoeksma

View GitHub Profile
@hphoeksma
hphoeksma / sass2scss.sh
Created March 19, 2020 11:07
Recursively migrate .sass files to .scss
#!/bin/bash
# @see https://github.com/mgreter/sass2scss
# That utility should be installed first. For macOS users, install it in
# /usr/local/bin i.o. /usr/bin
for file in $(find . -name "*.sass")
do
sass2scss -p -p -k < "${file%.*}.sass" > "${file%.*}.scss"
echo "🚀 ${file%.*}.sass is migrated, now removing..."
rm "${file%.*}.sass"
@hphoeksma
hphoeksma / assignment.txt
Last active February 21, 2020 10:09
DOM Cardio
// Maak een input in de html met als name attribute name
// Plaats een event listener op het event blur
// Geef een hallo melding met de ingevulde naam (maak hier voor een h1)
// Advanced
// Check voor het teruggeven van de hallo melding wat de tijd is
// Is het voor 12 uur s middags, begroet dan met Goedemorgen en anders
// met goede middag.
// Is het na 18:00 begroet dan met goedenavond ...
@hphoeksma
hphoeksma / rename nested .ts2 to .fusion
Last active February 20, 2020 10:51
Recursively rename file extension
find . -name "*.ts2" -exec rename 's/\.ts2$/\.fusion/' '{}' \;
@hphoeksma
hphoeksma / prefix_replace.sql
Created October 18, 2019 19:34
Replace all db prefixes with another
# Outputs a query you can then execute.
# 'test' in the TABLE_SCHEMA declaration is the name of the DB you are operating upon
SELECT
CONCAT('RENAME TABLE ', GROUP_CONCAT('`', TABLE_SCHEMA, '`.`', TABLE_NAME, '` TO `', TABLE_SCHEMA, '`.`', replace(TABLE_NAME, 'db_X', 'db_Y'), '`')) AS q
FROM
`information_schema`.`tables` WHERE TABLE_SCHEMA='test';
@hphoeksma
hphoeksma / update.sql
Created June 20, 2016 12:32
Update path and parentpath
// our table
UPDATE `typo3_typo3cr_domain_model_nodedata`
// Update values
SET
// Replace the path
path = REPLACE(path, '/sites/mysite/node-568e7b938a1e6/node-568e7c90a669b/node-572337907e5f2', '/sites/mysite/node-568e7b938a1e6/node-568e7c90a669b/node-5767cf3450486'),
// Replace the pathhash
`pathhash` = MD5(`path`)
// Replace the parentpath
@hphoeksma
hphoeksma / Sharelinks.html
Last active April 21, 2016 13:41
Sharelinks for nodes (Neos) with FontAwesome icons & scss
privilegeTargets:
'TYPO3\Neos\Security\Authorization\Privilege\NodeTreePrivilege':
'Vendor.Site:AllPages':
matcher: 'isDescendantNodeOf("/sites/mysite")'
'Vendor.Site:JustSomeRoleKey':
matcher: 'isDescendantNodeOf("/sites/mysite/node-56e6dcaf1ef9c")'
roles:
@hphoeksma
hphoeksma / TYPO3CR.Search.Paginator.Routes.yaml
Created February 16, 2016 10:22
Routes for the TYPO3CR.Search Paginator
-
name: 'Search paginate'
uriPattern: '{node}/{--typo3-typo3cr-search-viewhelpers-widget-paginateviewhelper.currentPage}'
defaults:
'@package': 'TYPO3.Neos'
'@controller': 'Frontend\Node'
'@format': 'html'
'@action': 'show'
'--typo3-typo3cr-search-viewhelpers-widget-paginateviewhelper':
'@package': ''
@hphoeksma
hphoeksma / Linkt to vcard.html
Last active December 4, 2015 13:43
Vcard 3.0 Fluid template
<neos:link.node node="{node}" format="vcard">
<img src="{f:uri.resource(path:'assets/images/icons/vcard.png', package:'Vendor.Site')}" alt=""/>
</neos:link.node>
@hphoeksma
hphoeksma / Settings.yaml
Last active December 4, 2015 09:43
Enable the history module in Neos
TYPO3:
Neos:
eventLog:
enabled: TRUE