Skip to content

Instantly share code, notes, and snippets.

View dviramontes's full-sized avatar
〰️
failing forward

David Viramontes dviramontes

〰️
failing forward
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[p5.js]" />
<meta charset="utf-8">
<title>JS Bin</title>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.8/processing.min.js"></script>
</head>
<body>
<canvas id="canvas1" width="200" height="200" border="1"></canvas>
@dviramontes
dviramontes / index.html
Last active May 22, 2017 05:24
JS Bin [p5.js] // source http://jsbin.com/qitexamoki
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[p5.js]" />
<meta charset="utf-8">
<title>JS Bin</title>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.8/processing.min.js"></script>
</head>
<body>
<canvas id="canvas1" width="200" height="200" border="1"></canvas>
@dviramontes
dviramontes / res.json
Created July 18, 2016 02:02
contentful management response
[
{
"sys": {
"publishedAt": "2016-06-22T03:52:38.355Z",
"space": {
"sys": {
"type": "Link",
"linkType": "Space",
"id": "2efkk6oex1yh"
}
@dviramontes
dviramontes / jsonParser.js
Last active June 15, 2016 03:40
Ext.decode vs JSON.parse
// 48 instances of Ext.decode
// 23 instances of Ext.encode
// collection size 7
(function() {
console.time('test')
var x = Ext.decode(temp1.responseText);
console.timeEnd('test')
console.log(x)
})()//test: 0.597ms
@dviramontes
dviramontes / cors.js
Created June 19, 2013 22:13
cors.js Nicholas Zakas' helper method to help sort out the browser differences in CORS or Cross Origin Resource Sharing support.
function createCORSRequest(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
// Check if the XMLHttpRequest object has a "withCredentials" property.
// "withCredentials" only exists on XMLHTTPRequest2 objects.
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
// register these two event listeners
window.player.on("play", function(){ console.log("played")});
window.player.on("pause", function(){ console.log("paused")});
body{
padding-top: 100px;
font-size:50px;
}
@dviramontes
dviramontes / gist:7683882
Created November 27, 2013 21:53
homepage.less
// @import "./utils/functions.less" ;
// @import "./utils/actionSection.less" ;
// @import "./utils/captions.less" ;
// @import "./utils/colors.less" ;
// TESTIMONIAL IMG
// ---------------
.testimonial img{
width: 100%;
@dviramontes
dviramontes / code.js
Last active December 26, 2015 04:09
email validation with jquery plugin
// validate email address
$("#ss-form").validate({
// validate rule
rules : {
email : {
required: true,
email: true
}
},
// for smallest jquery include ever...
function $(expr, cond){ return (con || document).querySelector(expr); }