Skip to content

Instantly share code, notes, and snippets.

@zipus
zipus / canvasline.html
Created July 25, 2012 18:18
Little canvas line
var canvas = document.getElementById('myCanvas');
paper.setup(canvas);
var path = new paper.Path();
// ... change this color
path.strokeColor = 'green';
// ... change the starting point of the line
var start = new paper.Point(30, 92);
path.moveTo(start);
// ... change the final point
@zipus
zipus / apod.php
Created June 18, 2012 14:07 — forked from gialloporpora/apod.php
With this code (PHP) you can create an URL that automatically redirect to the APOD (Astronomy Image Of the Day)
/*
With the following code you can create a static url that automatically redirect to the apod (Astronomy Image of the day
* You can use it like wallpaper in your Firefox's about:home page. Look at next file
Download Simple HTML parser from here:
http://simplehtmldom.sourceforge.net/
*/
<?php
$firefoxgalaxy="/image/0502/v838monOct2004_hst_f.jpg";
include('simple_html_dom.php');
$url="http://apod.nasa.gov";
@zipus
zipus / canvas-image.js
Created June 18, 2012 13:55
Canvas to Image | Image to Canvas
//extracted of http://davidwalsh.name/convert-canvas-image
function convertImageToCanvas(image) {
var canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
canvas.getContext("2d").drawImage(image, 0, 0);
return canvas;
}
function convertCanvasToImage(canvas) {