This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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"}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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; | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
fold -w 80 < /dev/stdin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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}} { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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} { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |