Skip to content

Instantly share code, notes, and snippets.

@procky
procky / Animated sprite menu.markdown
Created November 18, 2015 13:14
Animated sprite menu

Animated sprite menu

Mostly css but requires js if you are picky like me. Feel free to remove the js.

A Pen by Adam Wicks on CodePen.

License.

@procky
procky / gist:d20747ffb22de4bc79df
Last active August 29, 2015 14:14
Dump Mysql tables from a database, 1 table per file, using a bat file. db tables to separate sql files via Windows Batch script.
@echo off
set /p userDBName= Enter db name to backup:
set /p userHost= Enter mysql host (e.g. 127.0.0.1):
set /p userName= Enter mysql username (e.g. root):
:: This is set to my local time, in uk time format I would presume
md C:\backups\%userDBName%-%DATE:~-4%-%DATE:~-7,2%-%DATE:~0,2%
@procky
procky / gist:2fa788d564ce0850aa76
Last active October 22, 2021 21:17
fuzzy search collections in backbone.js with fuse.js
// backbone collections lack a search functionality. This adds it to all collections.
// fuse.js is the library that powers the fuzzy search and requires being downloaded and included into your app
// http://kiro.me/projects/fuse.html
_.extend(Backbone.Collection.prototype, {
searchableFields: null,
buildSearchIndex: function(options) {
options = (typeof options !== 'undefined') ? options : {};
@procky
procky / gist:5a0a3e178ccb87562f07
Last active October 22, 2021 20:40
Sort by multiple attributes in a backbone collection in the browser
// A multi columns sort implementation that sorts like SQL ORDER BY.
_.extend(Backbone.Collection.prototype, {
sortOptions: null,
comparator: function(a, b) {
var atts = [], dirs = [], att, i;
if(!this.sortOptions) {
return 0;
}