This file contains 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
/** | |
* This snippet minified the html output of your php application, just paste this code | |
* at the top of your application's entry point | |
* | |
* NOTE: <script>, <style>, <pre> and <textarea> tags are not processed by this script, which is a good thing | |
* | |
* NOTE: you will need PHP_VERSION >= 5.3 to run this code | |
* | |
* NOTE: all the whitespace between tags will be deleted, affecting the visual presentation of your webpage, | |
* consider this example: <span>Hello, <span>Joe</span></span> -> it will be modified to this -> |
This file contains 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
Show hidden characters
{ | |
"cmd": [ "wcl", "/l=dos", "$file_name" ], | |
"working_dir": "${project_path:${folder}}", | |
"selector": "source.c" | |
} |
This file contains 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
/** | |
* Mandelbrot set implementation in TURBO-C | |
* | |
* To compile follow these steps: | |
* > tcc -ml mandel.c | |
* > tlink c0m mandel, mandel,, emu fp87 mathm graphics cm | |
* > mandel | |
* | |
* By Robert Lafore - 1989 | |
* for the book Turbo C - Programming for the PC |
This file contains 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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Translation and rotation algorithm in a 2D space</title> | |
<style> | |
body { | |
background: peru; | |
font: 12px Tahoma, Ubuntu; | |
} |
This file contains 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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Scaling 2D bitmap</title> | |
<style> | |
body { | |
background: peru; | |
font: 12px Tahoma, Ubuntu; | |
} |
This file contains 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 line( xa,ya, xb,yb ) { | |
dx = xb - xa; | |
dy = yb - ya; | |
if( dx < 0 ) { | |
cInc = -1; | |
} else { | |
cInc = 1; | |
} | |
if( dy < 0 ) { |
This file contains 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 vLine( ya,yb, xa ) { | |
ya = Math.round( ya ); | |
yb = Math.round( yb ); | |
xa = Math.round( xa ); | |
var y = ya < yb ? ya : yb, | |
i = Math.abs( ya - yb ); | |
for( ; i >= 0; i-- ) { | |
console.log( 'plot', xa, y+i ); | |
} |
This file contains 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 long2LittleEndian( val ) { | |
return new Uint8Array( [ val & 0x000000ff, (val & 0x0000ff00) >> 8, (val & 0x00ff0000) >> 16, (val & 0xff000000) >> 24 ] ); | |
} | |
function bmp( width, height, canvas ) { | |
var extraBytes = width % 4, | |
canvaSize = height*(width*3 + extraBytes), | |
fileSize = 54 + canvaSize, | |
fz = long2LittleEndian( fileSize ), | |
w = long2LittleEndian( width ), |
This file contains 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
var polygonFilling = function( vertices ) { | |
// "global" variables | |
var verticesCount = vertices.length, | |
edgesEntered, | |
// table cols | |
yMax, yMin, xInt, invNegSlope; | |
// ************************* |
This file contains 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
var download = function( arrayBuffer ) { | |
var $a = document.createElement( 'a' ); | |
$a.setAttribute( 'download', +new Date() + '.bmp' ); | |
$a.setAttribute( 'href', URL.createObjectURL( new Blob( [ arrayBuffer ], { type: 'application/octet-binary' } ) ) ); | |
$a.style.display = 'none'; | |
document.body.appendChild( $a ); | |
$a.click(); | |
document.body.removeChild( $a ); | |
} |
OlderNewer