Skip to content

Instantly share code, notes, and snippets.

@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 / 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
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 / 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') {
@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 / jquery-pagify-example.html
Last active January 2, 2022 04:19
jquery.pagify.js
<!doctype html>
<html>
<title>jquery.pagify.js</title>
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="jquery.pagify.js"></script>
<style type="text/css">
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@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 ~ ~ ~"
// More information: https://danielupshaw.com/openscad-rounded-corners/
module roundedcube_simple(size = [1, 1, 1], center = false, radius = 0.5) {
// If single value, convert to [x, y, z] vector
size = (size[0] == undef) ? [size, size, size] : size;
translate = (center == false) ?
[radius, radius, radius] :
[
radius - (size[0] / 2),
@groovenectar
groovenectar / roundedcube.scad
Last active April 6, 2024 04:40
roundedcube.scad - Fork me and make me better!
// More information: https://danielupshaw.com/openscad-rounded-corners/
// Set to 0.01 for higher definition curves (renders slower)
$fs = 0.15;
module roundedcube(size = [1, 1, 1], center = false, radius = 0.5, apply_to = "all") {
// If single value, convert to [x, y, z] vector
size = (size[0] == undef) ? [size, size, size] : size;
translate_min = radius;