Skip to content

Instantly share code, notes, and snippets.

View hashplus's full-sized avatar
🇨🇳

p(^-^q) hashplus

🇨🇳
  • CN
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<script src="http://modernizr.com/downloads/modernizr-latest.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<canvas width="500" height="500" id="canvas"></canvas>
<script id="jsbin-javascript">
@hashplus
hashplus / bezier.js
Last active August 29, 2015 14:12 — forked from LiuJi-Jim/bezier.js
function DeCasteljauBezier(points, density, step){
//if (points.length < 3) return null;
console.time('bezier');
var ps = points.map(function(p){
return {
x: p.x,
y: p.y
};
}),
results = [],
<!DOCTYPE html>
<html>
<head>
<script src="http://modernizr.com/downloads/modernizr-latest.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<canvas id="canvas" width="256" height="256" style="position:absolute;top:50px;left:50px;">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
#results li.pass {
color: green;
}
#results li.fail {
<!DOCTYPE html>
<html>
<head>
<script src="http://modernizr.com/downloads/modernizr-latest.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<canvas id="canvasOne" width="600" height="200">
var str = 'hello <%= obj.name %>, upperized: <%= obj.name.toUpperCase() %>';
var ctx = {name: 'Hashplus'};
var go = function(str){
return new Function('obj',[
'var p = [];',
'p.push(',
'"' + str.replace(/<%= (.*?) %>/g, '", $1, "') + '"',
');',
'return p.join("")',
].join(''));
function require(name, deps, fn){
var args = [].slice.call(arguments);
if(typeof args[0] !== 'string'){
args.splice(0, 0, null);
}
if(!(args[1] instanceof Array)){
args.splice(1, 0, []);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.bc{
width:500px;
height:300px;
background-color: green;
<!DOCTYPE html>
<html>
<head>
<link href="http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.7/TweenMax.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.7/TweenMax.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
body {
font-family:sans-serif;