Skip to content

Instantly share code, notes, and snippets.

View GertSallaerts's full-sized avatar
😠

Gert Sallaerts GertSallaerts

😠
View GitHub Profile
@GertSallaerts
GertSallaerts / with-props-on-change.js
Created February 16, 2021 11:15
withPropsOnChange React hook
import { useMemo, useRef, useEffect } from 'react';
const withPropsOnChange = function (shouldMapOrKeys, createProps) {
return function usePropsOnChange(props) {
const memoIdxRef = useRef(0);
const prevPropsRef = useRef();
const prevProps = prevPropsRef.current;
useEffect(() => { prevPropsRef.current = props; });
@GertSallaerts
GertSallaerts / EXAMPLE.html
Last active April 15, 2016 15:19
Gemini Templates
<script type="text/html" data-bbbx-template="gallery.item">
<li class="fg4">
<div class="bbbx-item" style="width:100%;">
<a href="javascript:void(0);" rel="tooltip" data-bbbx-trigger="player.open" data-bbbx-entry="<%=id%>" data-bbbx-type="<%=type%>" data-direct-link="<%=getLink()%>">
<img src="<%=thumb_url%>" class="bbbx-item-thumb bbbx-loaded" width="100%">
<div class="bbbx-icon-type bbbx-icon-<%=type%>"></div>
<div class="bb-icon-play">
<p><%=meta.name%></p>
<img src="<%=info.thumb%>" width="25" height="25">
<strong><%=info.line1%></strong>
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
# forked by Gert Sallaerts
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
<div style="width:1130px;">
<div class="bbbx-widget" data-widget="3341"></div>
</div>
<!-- custom html -->
<script type="text/javascript">
var bbbx_widget_id = 3341;
/** custom settings **/
(function() {
var bbbx = document.createElement('script'); bbbx.type = 'text/javascript'; bbbx.async = true;
bbbx.src = '//api.bubobox.com/widget.js?id=' + bbbx_widget_id;
/**
* BuboBox form callback module
*
* @author Wim Mostmans ([email protected])
* @contributor Gert Sallaerts ([email protected])
*
* @license BSD
*
* Copyright (c) 2014 BuboBox
*/
@GertSallaerts
GertSallaerts / form.html
Last active August 29, 2015 13:56 — forked from Sitebase/form.html
<label for="name">Name</label>
<input type="text" name="name" id="name" value="" />
<label for="email">Email</label>
<input type="email" name="email" id="email" value="" data-validation-rule="valid_email" />
<div data-bbbx-init="upload" class="bbbx-button" id="upload3" data-bbbx-type="attachment">
<div class="bbbx-upload-label">Choose your image</div>
<div class="bbbx-upload-progress">Uploading file <span data-bbbx-init="upload.progress">0</span>%</div>
<div class="bbbx-upload-success">File is uploaded</div>
@GertSallaerts
GertSallaerts / form.html
Last active January 2, 2016 09:09 — forked from Sitebase/form.html
<p>Use this screen to get some information about your user. It's fully customizable or you can leave it out if you don't need to know anything about your user.</p>
<label for="name">Name <span>*</span></label>
<input type="text" name="name" id="name" value="" data-validation-rule="required" />
<label for="email">Email <span>*</span></label>
<input type="email" name="email" id="email" value="" data-validation-rule="required|valid_email" />
<label for="website">Website</label>
<input type="website" name="website" id="website" value="" data-validation-rule="valid_url" />