Skip to content

Instantly share code, notes, and snippets.

@chranderson
chranderson / nvmCommands.js
Last active April 11, 2025 10:24
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@VinnyFonseca
VinnyFonseca / addeventlistener-multiple-events.js
Last active January 12, 2023 16:08
addEventListener multiple events
['change', 'keyup', 'paste', 'input', 'propertychange', 'every_other_event_you_want'].forEach(eventType => {
[...document.querySelectorAll('SELECTOR')].forEach(element => {
element.addEventListener(eventType, (event) => {
console.log(event);
// Your callback here
}, false);
});
});
@pavelbinar
pavelbinar / extract-subtitles-from-mkv.md
Last active November 30, 2024 14:48 — forked from bmaeser/subtitle-extract.txt
Extract subtitles from .mkv files on Mac OS X
@adamwathan
adamwathan / troubleshooting.md
Last active January 23, 2025 08:49
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart
@mgibbs189
mgibbs189 / functions.php
Created September 1, 2016 11:36
FacetWP - trick FacetWP into supporting multiple data sources
<?php
// we have 3 facets: my_autcomplete, my_autocomplete_2, my_autocomplete_3
// trick FacetWP into using _2 and _3's values for the first facet
function my_facetwp_index_row( $params, $class ) {
$name = $params['facet_name'];
if ( 'my_autocomplete_2' == $name || 'my_autocomplete_3' == $name ) {
$params['facet_name'] = 'my_autocomplete';
}
return $params;
@eeichinger
eeichinger / readme.md
Last active October 16, 2023 14:26
Pimp my OSX - list of tools & utilities on OSX I can't live without
@derekshirk
derekshirk / acf-inline-svg.php
Created July 20, 2016 22:14
Output Inline SVGs from ACF image field
<?php
/* ————————————————————————— */
/* ACF Inline SVGs
/* ————————————————————————— */
$repeater = 'repeater_field_name'
if ( have_rows( $repeater ) ): ?>
<section class="content-main">
<div class="container"> <?php
@Jany-M
Jany-M / wp_ics.php
Last active March 13, 2025 00:56 — forked from jakebellacera/ICS.php
[WP] Generate a downloadable .ics file from any WordPress post or custom post type
<?php
/*
For a better understanding of ics requirements and time formats
please check https://gist.github.com/jakebellacera/635416
*/
// UTILS
// Check if string is a timestamp
@cliffordp
cliffordp / single-event.php
Last active October 5, 2022 16:20
Custom PHOTO VIEW to add Organizer and Venue details. -- Place in this location: /wp-content/themes/YOUR_THEME_DIRECTORY/tribe-events/pro/photo/single-event.php -- and delete whatever you do not need or want -- A GIF preview of the result: http://cl.ly/0R2r0Q0F0L03
<?php
/**
* Photo View Single Event
* This file contains one event in the photo view
*
* @package TribeEventsCalendar
*
*/
if ( ! defined( 'ABSPATH' ) ) {
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);