Skip to content

Instantly share code, notes, and snippets.

@cpitt
cpitt / memoizeLocalStorage.js
Last active May 3, 2024 03:58
Memoize a function using local storage as it's cache
/**
* memoizes a function using localStorage as the cache
* @param {function|Promise} fn function or promise you wish to memoize
* @param {Object} [options] additional configuration
* @param {number} [options.ttl=0] time to live in seconds
* @param {Boolean} [options.backgroundRefresh=false] whether the cache should be refreshed asynchronously,
* Note: new results won't resolve until next execution
* @return {Promise} Promise object represents memoized result
*/
function memoizeLocalStorage(
@rickrduncan
rickrduncan / remove-seo.php
Created February 7, 2014 11:47
Remove 'SEO' from admin bar for users of WordPress SEO by Yoast. The code belongs in your functions.php file or better yet a functionality plugin.
<?php
//* Do NOT include the opening php tag
//* Remove the link 'SEO' from admin bar. It's placed there by the plugin WordPress SEO by Yoast.
add_action( 'wp_before_admin_bar_render', 'wlwp_admin_bar' );
function wlwp_admin_bar(){
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wpseo-menu');
}
@kmila
kmila / log4j_udl.xml
Last active December 19, 2019 19:24 — forked from mmdemirbas/LogFile.udl.xml
Notepad++/Scintilla UDL to enable log4j syntax highlighting
<NotepadPlus>
<UserLang name="log4j" ext="log">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="yes" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">[(0])0</Keywords>
<Keywords name="Folder+"></Keywords>