Skip to content

Instantly share code, notes, and snippets.

View octavioamu's full-sized avatar
:octocat:
Working from home

Octavio Amuchástegui octavioamu

:octocat:
Working from home
View GitHub Profile
@octavioamu
octavioamu / data-href.js
Created December 2, 2013 23:08
Let you define an href on any element: https://github.com/nathanford/data-href
sethrefs = function () {
if (document.querySelectorAll) {
var datahrefs = document.querySelectorAll('[data-href]'),
dhcount = datahrefs.length;
while (dhcount-- > 0) {
var ele = datahrefs[dhcount],
@octavioamu
octavioamu / social-buttons.html
Created November 6, 2013 13:35
Social buttons no js
<a target="_blank" href="https://twitter.com/intent/tweet?text=YOUR-TITLE&url=YOUR-URL&via=TWITTER-HANDLE">Tweet</a>
<a target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=YOUR-URL">Share on Facebook</a>
<a target="_blank" href="https://plus.google.com/share?url=YOUR-URL">Plus on Google+</a>
<a target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=YOUR-URL&title=YOUR-TITLE&summary=YOUR-SUMMARY&source=YOUR-URL">Share on LinkedIn</a>
<a target="_blank" href="http://pinterest.com/pin/create/button/?url=YOUR-URL&description=YOUR-DESCRIPTION&media=YOUR-IMAGE-SRC">Pin on Pinterest</a>
$.fn.extend( {
limiter: function(limit, elem) {
$(this).on("keyup focus", function() {
setCount(this, elem);
});
function setCount(src, elem) {
var chars = src.value.length;
if (chars > limit) {
src.value = src.value.substr(0, limit);
chars = limit;
@octavioamu
octavioamu / Preferences.sublime-settings
Created September 4, 2013 13:38
Sublime text custom preferences
{
"dictionary": "Packages/Language - English/en_US.dic",
"font_face": "Source Code Pro",
"font_options":
[
"subpixel_antialias"
],
"ignored_packages":
[
"Vintage"
@octavioamu
octavioamu / drop-shadow
Created August 21, 2013 14:25
Firefox fallback to css filters -webkit-filter: drop-shadow(12px 12px 7px rgba(0,0,0,0.5)); filter: url(shadow.svg#drop-shadow);
<svg height="0" xmlns="http://www.w3.org/2000/svg">
<filter id="drop-shadow">
<feGaussianBlur in="SourceAlpha" stdDeviation="2.2"/>
<feOffset dx="12" dy="12" result="offsetblur"/>
<feFlood flood-color="rgba(0,0,0,0.5)"/>
<feComposite in2="offsetblur" operator="in"/>
<feMerge>
<feMergeNode/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
@octavioamu
octavioamu / gist:4674937
Last active December 11, 2015 23:09
javaScript:collapsible
$(".collapsible-content").hide();
$(".collapsible-head").toggle(function(){
$(this).addClass("active");
}, function () {
$(this).removeClass("active");
});
$(".collapsible-head").off('click').on('click',function(){
$(this).next(".collapsible-content").slideToggle(600);
});
@octavioamu
octavioamu / html5.html
Created October 3, 2012 13:52
An HTML5 Layout That Works in IE
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<html>
<head>
<title>An HTML5 Layout That Works in IE</title>
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->
@octavioamu
octavioamu / sample.html
Created July 31, 2012 22:19
Accordion show open with the current url
<nav class="main-nav">
<ul>
<li>
<a href="/escola" title="" class="home">
<i></i>
<span>Início</span>
</a>
</li>
<li class="dropdown">

Adaptive Image Element

Author:

Mat Marquis

Status of this Document

This is an unofficial draft spec, not formally endorsed by the WHATWG. It is suitable only for reviewing the details of the proposed element.

Table of Contents

@octavioamu
octavioamu / tabs.css
Created April 16, 2012 18:38
Tabs from Skeleton
/* #Tabs (activate in tabs.js)
================================================== */
ul.tabs {
display: block;
margin: 0 0 20px 0;
padding: 0;
border-bottom: solid 1px #ddd; }
ul.tabs li {
display: block;
width: auto;