Skip to content

Instantly share code, notes, and snippets.

@nickcernis
nickcernis / mariadb-brew-macos.md
Last active August 7, 2025 15:47
Install MariaDB with brew on macOS and fix the “access denied” issue

Edit — best to first try:

mariadb-secure-installation -u $(whoami)

Original version here below in case the above does not work for you.


@mrmartineau
mrmartineau / stimulus.md
Last active May 16, 2025 13:02
Stimulus cheatsheet
@yairEO
yairEO / events.namespace.js
Last active August 11, 2023 07:08
Event Handler Namespace in Vanilla JavaScript
var events = (function(){
function addRemove(op, events, cb){
if( cb )
events.split(' ').forEach(name => {
var ev = name.split('.')[0]
cb = cb || this._eventsNS[name]
this[op + 'EventListener'].call(this, ev, cb)
if(op == 'add')
@prasadsilva
prasadsilva / fresh-chrome-with-custom-tz.sh
Last active October 8, 2024 12:47 — forked from stuartsierra/fresh-chrome.sh
Launch new instances of Google Chrome on OS X with isolated cache, cookies, user config and custom Timezone
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@sandstrom
sandstrom / fast_select.js
Last active December 16, 2015 12:49
Faster Em.Select
// A static select where options aren't child-views but plain option tags.
// This implementation is currently much faster than Em.Select on large collections.
(function() {
// shortcuts
var set = Em.set, get = Em.get;
Em.FastSelect = Em.Select.extend({
@ariera
ariera / README.markdown
Created August 7, 2011 16:23
Nestable, sortable and dragable categories

Nestable, sortable and dragable categories:

In the project I'm working on we wanted to have a Category model which we wanted to be nestable. But we also liked the user to have a draggable interface to manage and rearrange the order of his categories. So we chose awesome_nested_set for the model and jQuery.nestedSortable for the UI.

It took me some time to arrange things to work properly so I wanted to share my work in case it helps anybody.

Before beginning

you might want to take a look at a demo app

  1. go to: http://awesomenestedsortable.heroku.com/groups/
  2. click in show of any group