Skip to content

Instantly share code, notes, and snippets.

/*
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;
@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) {
@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 / 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 / tabs_to_bottom.css
Last active November 5, 2023 19:58
Firefox CSS to move tabs and adress bar to bottom of window. Use with userChrome.css (works with Firefox 71+)
This script has moved to https://github.com/Arty2/userstyles
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from email.header import Header
from email.mime.text import MIMEText
from getpass import getpass
from smtplib import SMTP_SSL
import sys
#edit the line below
@Arty2
Arty2 / copypasta.js
Created October 31, 2015 10:25
Copy & paste hijacking for forcing credit with "Read more" and URL. Antilogue: http://daringfireball.net/2010/05/tynt_copy_paste_jerks
/*
copy & paste hijacking for forcing credit with "Read more" and URL
antilogue: http://daringfireball.net/2010/05/tynt_copy_paste_jerks
*/
function copypasta() {
var body_element = document.body;
var pagelink = ' Read more: '+window.location.href.split('#')[0]+'';
if (window.getSelection) {
var selection = window.getSelection();
var copytext = selection.toString().replace(/\n/g, '<br />') + '<br /><br /><br />' + pagelink;
@Arty2
Arty2 / toggle_endpoints.rb
Created November 12, 2015 12:41
SketchUp plugin — Provides a function to toggle EndPoints on/off
# Name : Toggle EndPoints
# Description : Provides a function to toggle EndPoints on/off
# Author : Heracles Papatheodorou
# Usage : Tools → Toggle EnPoints (hint: assign to keyboard shortcut)
# Date : 27.Jul.2004
# Type : tool
# History:
# 1.0 (2013.04.07) - Initial version.
require 'sketchup.rb'
@Arty2
Arty2 / acropolis_tiles.html
Created November 12, 2015 12:42
Strip tiles from http://acropolis-gis.ysma.gr/ (requires tweaking the code)
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'>
</head>
<body>
<canvas id="canvas"></canvas>
<script>
/*
@Arty2
Arty2 / bing_tiles.html
Created November 12, 2015 12:43
Strip bird's view tiles from Bing maps (requires tweaking the code)
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<canvas id="canvas"></canvas>
<script>
var tile_w = 256;
var tile_h = 256;