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
@dviramontes
dviramontes / stack d3 transformations
Created October 31, 2014 03:59
stack d3 transformations
// stack transform method 1
.attr("transform", d3.transform('...').toString())
// stack transform method 2
.attr("transform", function () {
return this.getAttribute("transform") + "scale(0.75)" + "translate(" + 0 + "," + cellSize + ")"
})
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script src="http://code.jquery.com/jquery-git2.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta charset="utf-8">
<!DOCTYPE html>
<html>
<head>
<!-- TRUMBA DEPSNDS ON JQUERY -->
<script src="http://code.jquery.com/jquery-git2.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<!-- Trumna Code -->
@dviramontes
dviramontes / index.html
Created February 18, 2014 04:46
Multiple versions of jquery, same page
<html>
<head>
<link rel="stylesheet" href=" //netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
</head>
<body>
<div class="jumbotron">
<div class="container">
<p>1. jquery version : </p>
</div>
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); }
$(document).ready(function () {
var iec = new IECompatibility();
alert('IsIE: ' + iec.IsIE + '\nVersion: ' + iec.Version + '\nCompatability On: ' + iec.IsOn);
});
function IECompatibility() {
var agentStr = navigator.userAgent;
this.IsIE = false;
this.IsOn = undefined; //defined only if IE
this.Version = undefined;
@dviramontes
dviramontes / click.js
Created August 22, 2013 17:28
makes anything with class .clickable, clickable
$(".clickable").click(function(event) {
event.preventDefault();
if ($(this).data().href) {
return window.open($(this).data().href, "_self");
}
});