Skip to content

Instantly share code, notes, and snippets.

@groovenectar
groovenectar / clave.tidal
Last active April 22, 2022 03:46
Attempting a clave pattern in TidalCycles
-- Rough start - needs more fine-tuning
d1 $ sound "[gretsch:6 ~ gretsch:6 ~ gretsch:6] [~ gretsch:6 gretsch:6 ~]"
d2 $ sound "gretsch:6 ~ ~ gretsch:6 ~ ~ gretsch:6 ~ ~ ~ gretsch:6 ~ gretsch:6 ~ ~ ~"
@groovenectar
groovenectar / knockout-js-datetime-input.js
Last active August 20, 2021 23:04
A KnockoutJS component to create date/time inputs that work together to update a single observable value. This value gets passed in as a parameter, `datetimeObservable`. This value is updated in realtime on every keypress.
// Usage: <datetime params="id: 'any-unique-id', datetimeObservable: observableDateTimeObjectFromParentViewModel, default: defaultDateObject, min: new Date(), max: maxDateObject"></datetime>
ko.components.register('datetime', {
viewModel: function(params) {
this.dateid = params.id + '-date';
this.timeid = params.id + '-time';
this.date = '';
this.time = '';
this.datetimeObservable = params.datetimeObservable;
@groovenectar
groovenectar / knockoutjs-date-binding.js
Created June 3, 2021 06:53
Date Binding for Knoockout JS
ko.bindingHandlers.date = {
update: function(element, valueAccessor) {
// First get the latest data that we're bound to
let data = valueAccessor();
// Next, whether or not the supplied model property is observable, get its current value
let value = ko.unwrap(data);
let prop = element.nodeName === 'INPUT' ? 'value' : 'innerText';
if (value instanceof Date) {
if (element.type === 'date') {
ZIP,LAT,LNG
00601,18.180555,-66.749961
00602,18.361945,-67.175597
00603,18.455183,-67.119887
00606,18.158345,-66.932911
00610,18.295366,-67.125135
00612,18.402253,-66.711397
00616,18.420412,-66.671979
00617,18.445147,-66.559696
00622,17.991245,-67.153993
@groovenectar
groovenectar / OpenWithSublimeText3.bat
Last active March 1, 2017 17:59 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=D:\Programs\Sublime Text 3\sublime_text.exe
rem add it for all file types
rem commented because it's already an option during installation
rem @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
rem @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
rem @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@groovenectar
groovenectar / windows-permissions-reset.md
Last active November 22, 2016 22:45
Windows - Resetting folder/file permissions - Generic fix for permission denied errors in Windows Explorer
@groovenectar
groovenectar / .gitignore
Last active October 10, 2016 15:54 — forked from erfanimani/.gitignore
A refactored and modern .gitignore for Magento. Compatible for Git versions 2.7.0+. See this revision to use it for versions lower than 2.7.0: https://gist.github.com/erfanimani/8856964/886f5d79d229c21b9c712155c362e5fc1c61a12a
### MAGENTO DIRECTORIES
# Ignore everything in media, except for the htaccess files
# Also include the Lazy Catalog Images (LCI) .htaccess if that's installed
# (https://github.com/AOEpeople/Aoe_LazyCatalogImages)
/media/*
!/media/.htaccess
!/media/customer/.htaccess
!/media/downloadable/.htaccess
!/media/catalog/product/LCI/.htaccess
@groovenectar
groovenectar / http-auth.php
Created June 16, 2016 21:30
Updated HTTP Auth plugin for Wordpress -- https://wordpress.org/plugins/http-auth/
<?php
/*
Plugin Name: Http Auth
Plugin URI: https://wordpress.org/plugins/http-auth/
Description: This plugin allows you apply HTTP Auth on your site. You can apply Http Authentication all over the site or only the admin pages.
Version: 0.1
Author: Sami Ahmed Siddiqui and Yasir Ahmed Siddiqui
Author URI: http://www.yasglobal.com
Text Domain: http-auth
*/
@groovenectar
groovenectar / 1px-transparent-png-base64.txt
Created November 17, 2015 19:23
1px transparent png base64
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=
<?php
// Add tag_slug__not_in to valid taxonomy queries
add_action('parse_tax_query', function($wp_query) {
$q = &$wp_query->query_vars;
$tax_query = array();
if (!empty($q['tag_slug__not_in'])) {
$q['tag_slug__not_in'] = array_map('sanitize_title_for_query', array_unique((array)$q['tag_slug__not_in']));
$tax_query[] = array(