Skip to content

Instantly share code, notes, and snippets.

View adriancmiranda's full-sized avatar
🌱
Today, what did you do for you tomorrow?

Adrian Miranda adriancmiranda

🌱
Today, what did you do for you tomorrow?
View GitHub Profile
@adriancmiranda
adriancmiranda / index.html
Created January 26, 2019 17:26
Perspective Split Text Menu Hover
<!-- @NOTE: the onclicks are used for touch devices since I'm lazy and didnt use <a> tags -->
<div class="Menu">
<ul class="Menu-list" data-offset="10">
<li class="Menu-list-item" data-offset="20" onclick>
Home
<span class="Mask"><span>Home</span></span>
<span class="Mask"><span>Home</span></span>
</li>
<li class="Menu-list-item" data-offset="16" onclick>
About
@adriancmiranda
adriancmiranda / ml-ruby.md
Created January 19, 2019 17:21 — forked from gbuesing/ml-ruby.md
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems

@adriancmiranda
adriancmiranda / d3-js-drag-and-drop-timeline.markdown
Created September 10, 2018 20:07
d3.js drag and drop timeline
@adriancmiranda
adriancmiranda / d3-minimap-pan-and-zoom.markdown
Created September 10, 2018 20:03
d3 Minimap Pan and Zoom
@adriancmiranda
adriancmiranda / README.md
Created July 17, 2018 16:24 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
// original (broken) version is here: http://ivan-ghandhi.livejournal.com/942493.html
// My fix: don't treat arguments as if it were an array
// (Use Array.prototype.slice.call() to convert it)
function stackTrace() {
var err = new Error();
console.log(typeof err.stack);
return err.stack;
}
function trimSvgWhitespace() {
// get all SVG objects in the DOM
var svgs = document.getElementsByTagName("svg");
// go through each one and add a viewbox that ensures all children are visible
for (var i=0, l=svgs.length; i<l; i++) {
var svg = svgs[i],
box = svg.getBBox(), // <- get the visual boundary required to view all children
@adriancmiranda
adriancmiranda / index.html
Created February 27, 2018 19:44
Landscape Circle SVG
<svg viewBox="0 0 500 500">
<g class="scene1">
<defs>
<clipPath id="circle">
<circle class="mask" cx="250" cy="250" r="100" />
</clipPath>
<clipPath id="ground">
<rect x="50" y="50" width="400" height="260" />
</clipPath>
</defs>
@adriancmiranda
adriancmiranda / index.html
Created August 16, 2017 19:56
Physics Demo
<div id="keysleft">
move: WASD
<br>Hold/Drop/Fire(hold it): E
<br>Pause: F
<br>Gravity: R
<br>Have fun
</div>
<div id="keysright">
zoom: + -
<br>fire: click