Skip to content

Instantly share code, notes, and snippets.

@Arty2
Arty2 / greek_small_caps.js
Last active August 29, 2015 14:02
jQuery plugin that fixes erroneous behaviour of browsers that display accents on Greek small-caps. At the time of writing, the latest versions of Firefox, Chrome and Opera behave properly.
/*--------------------------------------------------------------
Normalised Greek small-caps
fixes erroneous behaviour of browsers that display accents on Greek small-caps.
usage example, don't be greedy: $('dt:lang(el), h1:lang(el), h2:lang(el), h3:lang(el), a:lang(el)').greek_small_caps();
--------------------------------------------------------------*/
(function($) {
if (!jQuery().greek_small_caps) {
$.fn.greek_small_caps = function() {
String.prototype.replaceArray = function(search, replace) {
var text = this;
@Arty2
Arty2 / jquery.draggable.js
Last active November 26, 2020 12:28
jQuery plugin to make elements draggable without jQuery UI. Usage: view source on http://jqueryui.com/draggable/
/*--------------------------------------------------------------
Draggable
alternative to jQuery UI’s draggable
based on comments from: http://css-tricks.com/snippets/jquery/draggable-without-jquery-ui/
usage example: $('.post-thumbnail, article header').draggable();
--------------------------------------------------------------*/
(function($) {
if (!jQuery().draggable) {
$.fn.draggable = function() {
this
@Arty2
Arty2 / delete_deprecated_thumbs.php
Created March 6, 2014 14:07
Raw utility to remove all thumbnails files from WordPress's upload directory. Edit as necessary.
<?php
/**
* raw utility to delete deprecated thumbnail files
* to move into a plugin at some point
*/
// comment following line and move to WordPress root
if ( !defined('ABSPATH') ) die;
function files($base) {
/*
The object was to create a grading set of illusionist tiles.
Horizontal mouse movement sets hue. Vertical sets saturation. Scroll to increase/decrease tile count.
*/
int sketchWidth = 600;
int sketchHeight = sketchWidth;
int grid = 6; //number of triangle columns and rows
int shapeWidth, shapeHeight;