Skip to content

Instantly share code, notes, and snippets.

View joekolade's full-sized avatar

Joe Kolade joekolade

View GitHub Profile
@joekolade
joekolade / duplicates.sql
Created April 8, 2023 14:12
[DB Find duplicates in multiple fields]
SELECT c.uid as "CE uid", c.pid as "CE pid", uid_foreign, uid_local, count(*) as NumDuplicates
FROM sys_file_reference s
JOIN tt_content c ON (c.uid = s.uid_foreign)
WHERE s.tablenames = "tt_content"
AND s.deleted = 0
AND c.deleted = 0
GROUP BY uid_foreign, uid_local
@joekolade
joekolade / replace.sql
Created April 8, 2023 14:12
[DB replace string]
UPDATE tt_content
SET bodytext = replace(bodytext, "a", "b");
@joekolade
joekolade / summertime.js
Created April 8, 2023 14:13
[Summertime detection JS]
/**
* @param d date
*/
function isDST(d) {
let jan = new Date(d.getFullYear(),0,1).getTimezoneOffset();
let jul = new Date(d.getFullYear(),6,1).getTimezoneOffset();
return Math.min(jan,jul) == d.getTimezoneOffset();
}
@joekolade
joekolade / selfdestruction.js
Created April 8, 2023 14:13
[self destructing event listener]
let addSelfDestructingEventListener = (element, eventType, callback) => {
let handler = (e) => {
callback(e);
element.removeEventListener(eventType, handler);
};
element.addEventListener(eventType, handler);
};
@joekolade
joekolade / breakpoints.scss
Created April 8, 2023 14:14
[Breakpoints mixins]
/**
Breakpoints
*/
// define breakpoints
// ------------------------------
$breakpoints: (
micro: 320px,
xs: 502px,
sm: 768px,
@joekolade
joekolade / transition.scss
Created April 8, 2023 14:15
[Transition mixin]
// Transitions
//
//
$transition-default-duration: ###0.3s###;
$transition-default-timing: ease-out;
$transition-default-delay: 0s;
@mixin transit($prop: all){
transition: $prop $transition-default-duration $transition-default-timing $transition-default-delay;
}
@joekolade
joekolade / recursive_delete.sh
Created April 8, 2023 14:16
[Recursive find and delete]
find . \( -name '.DS_Store' -or -name '._*' \) -delete
@joekolade
joekolade / page.ts
Created April 8, 2023 14:17
[Page with fluid templates]
page = PAGE
# page.typeNum = 123
page.10 = FLUIDTEMPLATE
page.10 {
templateName = TEXT
templateName.stdWrap {
cObject = TEXT
cObject {
data = levelfield:-2,backend_layout_next_level,slide
@joekolade
joekolade / constraints.yaml
Created April 8, 2023 14:18
[PageType constraints]
'Neos.NodeTypes:Page':
childNodes:
'main':
constraints:
nodeTypes:
'Neos.NodeTypes:Headline': TRUE
'Neos.NodeTypes:Text': TRUE
'Neos.NodeTypes:Image': TRUE
'Neos.NodeTypes:Html': TRUE
'Neos.NodeTypes:TwoColumn': TRUE
@joekolade
joekolade / background.fusion
Created April 8, 2023 14:18
[Page background with image]
# NodeTypes.yaml
'Neos.NodeTypes:Page':
properties:
backgroundimage:
type: 'Neos\Media\Domain\Model\ImageInterface'
ui:
label: 'Hintergrund Bild'
inspector:
group: 'document'