Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Jigsaw puzzle</title>
<script type="text/javascript">
function save(filename, data)
{
var blob = new Blob([data], {type: "text/csv"});
@anoved
anoved / acc-svg-jacker.js
Last active May 21, 2017 05:03
Get SVG from Adobe Creative Cloud asset item page
(function(){
var a = document.getElementsByClassName("item")[0];
var s = a.style.backgroundImage;
var u = s.slice(5,-2);
var u_prefix = u.substring( 0, u.indexOf(":rendition") );
var u_suffix = u.substring( u.indexOf("api_key") );
var final = u_prefix + "?" + u_suffix;
window.location = final;
})();
@anoved
anoved / star.scad
Created March 18, 2014 15:48
OpenSCAD pointed star module
// points = number of points (minimum 3)
// outer = radius to outer points
// inner = radius to inner points
module Star(points, outer, inner) {
// polar to cartesian: radius/angle to x/y
function x(r, a) = r * cos(a);
function y(r, a) = r * sin(a);
// angular width of each pie slice of the star
@anoved
anoved / repetier_host
Created January 13, 2014 17:04
Tcl launcher script for Linux RepetierHost
#!/usr/bin/tclsh
# determine application directory automatically rather than rely on hard-coded path
cd [set dir [file dirname [file normalize [info script]]]]
exec /usr/bin/mono RepetierHost.exe -home $dir &
@anoved
anoved / gist:5178510
Created March 16, 2013 22:00
A simple Applescript to add the current article from Vienna (an RSS reader) to your Safari Reading List. Save to ~/Library/Scripts/Applications/Vienna.
tell application "Vienna"
set the_article to current article
set article_URL to the link of the_article
set article_title to the title of the_article
set article_intro to (body of the_article as text)
tell application "Safari" to add reading list item article_URL with title article_title and preview text article_intro
end tell
@anoved
anoved / gist:5076718
Created March 3, 2013 16:17
Hard wrap text filter for BBEdit. Works better for generic data than the built-in "Hard Wrap" command, which attempts to interpret the text to wrap as a prose text, and therefore inserts line breaks at various places including punctuation characters and spaces.
#!/bin/sh
fold -w 80 < /dev/stdin
@anoved
anoved / benchmark.tcl
Created February 22, 2013 19:15
A procedure to perform ballpark performance benchmarking of Tcl scripts. It is a simple alternative to the `bench` package in Tcllib.
#
# Parameters:
# script, the code to benchmark. Executed in caller's context.
# iterations, number of times to execute script. Defaults to 1.
#
# Returns:
# a two-element list reporting the average iteration time to execute script
# and the total elapsed time in microseconds.
#
proc benchmark {script {iterations 1}} {
@anoved
anoved / weather.tcl
Last active December 13, 2015 19:48
Weather demo script from Shapetcl commit 403e4508e5d774803b93294e96c3efdea5f3e7f5
#!/usr/bin/tclsh
lappend auto_path [file dirname [file dirname [file normalize [info script]]]]
package require shapetcl
package require http
package require json
if {$argc != 4} {
@anoved
anoved / readinglistdump.py
Created February 9, 2012 01:57
Reading List dump. Print information about unread items in Mac OS X's Safari 5.1+ "Reading List" bookmarks.
#!/usr/bin/env python
#
# What does this script do?
# It prints information about the Unread items in your Safari Reading List.
# The oldest item is printed first (maybe). Each item is printed on its own
# line. The line format is "Title", "Preview text", "URL", "bookmark date".
#
# What is the Safari Reading List?
# A category of bookmarks introduced in Safari 5.1, intended to represent