Skip to content

Instantly share code, notes, and snippets.

View espenmn's full-sized avatar

Espen Moe-Nilssen espenmn

View GitHub Profile
@espenmn
espenmn / edit.js
Last active October 19, 2023 10:52
/**
* Retrieves the translation of text.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/
*/
import { __ } from '@wordpress/i18n';
/**
* React hook that is used to mark the block wrapper element.
* It provides all the necessary props like the class name.
{ attributes.disableTitle && (
<ToggleControl
label="Whaterver control here"
onChange={ () => {
setAttributes( { disableImage: !attributes.disableImage } );
} }
checked={ attributes.disableImage }
/>
@espenmn
espenmn / functions.php
Created June 5, 2023 14:40
Add breadcrumbs wordpress
function get_breadcrumb() {
echo '<a href="'.home_url().'" rel="nofollow">Home</a>';
if (is_category() || is_single()) {
echo "&nbsp;|&nbsp;";
the_category(' &bull;');
if (is_single()) {
echo " &nbsp;|&nbsp; ";
the_title();
}
} elseif (is_page()) {
@espenmn
espenmn / bash
Last active October 2, 2023 10:17
bash start plugin node ubuntu local
source ~/.nvm/nvm.sh
nvm install v16.0.0
/plugins/gripblocks-medialog$ npm start
@espenmn
espenmn / reaper all script.scp
Created April 23, 2023 18:49
BND and Reaper script
--change "Users:gm:Downloads: to "Users:Jan:Desktop" or similar
tell application "REAPER" to activate
tell application "System Events" to tell process "REAPER"
tell menu bar item "File" of menu bar 1
click
delay 1
tell menu item "Project templates" of menu 1
click
@espenmn
espenmn / reaper_script.scp
Last active April 23, 2023 17:29
reaper export script
tell application "REAPER" to activate
tell application "System Events" to tell process "REAPER"
tell menu bar item "File" of menu bar 1
click
delay 1
tell menu item "Project templates" of menu 1
click
At home in this town, we often find
The time to goof off and unwind
But today is different, a brand new day
So may we start, and make our way
The radio hums, Edith Piaf's voice
Reminds us to make the right choice
To work hard, and do what we must
And leave behind our playful lust
tell application "Audacity"
activate
tell application "System Events"
keystroke "n" using {command down}
tell application "System Events"
--click "audio"
keystroke "i" using {command down, shift down}
delay 3
--change "Users:gm:Downloads: to "Users:Jan:Desktop" or similar
--folder for files must be chosen one time (?)
tell application "Finder"
global thedate
set thedate to (current date) as string
global bndItems
try
activate