Skip to content

Instantly share code, notes, and snippets.

@OneHoopyFrood
OneHoopyFrood / bulletedTextArea.jQuery.js
Created April 21, 2016 22:58
Quick little script to cause a text area to contain bullets on each newline. Adapted from: http://jsfiddle.net/abhiagrawal87/m39xt/
(function($) {
$.fn.bulletedTextArea = function() {
var ele = $(this);
var correctBlank = function() {
if (ele.val() === '' || ele.val() === '•') {
ele.val('• ');
}
}
@OneHoopyFrood
OneHoopyFrood / PaperjsRuler
Created July 1, 2014 17:58
Creates a ruler of the specified dimensions using paper.js (Written in paperscript)
// Paper.js Ruler object.
// Creates a ruler of the specified dimensions using paper.js
function Ruler(params) {
// Length of the ruler (px)
this.lengthOfRuler = params.lengthOfRuler;
// Space between ticks (px)
this.tickSpacing = params.tickSpacing;
// Show the number on the [nth] tick
this.numOnTick = params.numOnTick;
// Tick height (px)