Skip to content

Instantly share code, notes, and snippets.

View drocarmo's full-sized avatar

Pedro Carmo drocarmo

View GitHub Profile
@drocarmo
drocarmo / sortable.js
Created December 18, 2013 21:53
Sortable ajax JS
// Sortable shit
$(".connected").sortable({
connectWith: ".connected",
items: "> li",
placeholder: "sortable-placeholder",
revert: 100,
tolerance: "pointer",
scroll: false,
cancel: "[contenteditable], textarea, input",
@drocarmo
drocarmo / character.txt
Last active January 2, 2016 18:18
Character Cheat Sheet
These character sets are not exhaustive, but merely a quick reference for common characters.
Quotation
‘ ‘ \2018 Open single quotation mark
’ ’ \2019 Closed single quotation mark / Apostrophe
“ “ \201C Open double quotation mark
” ” \201D Closed double quotation mark
' ' \0027 Typewriter single quotation mark
" " \0022 Typewriter double quotation mark
′ ′ \2032 Prime (Feet / Minutes)
@drocarmo
drocarmo / animation.scss
Last active January 4, 2016 07:59
How to optimize @content-directive in sass mixins
// Variables
$fade: fade;
$slideDown: slideDown;
$duration: 1s;
// Default Animation mixins
@mixin animation {
-webkit-animation-fill-mode: both;
@drocarmo
drocarmo / menu.js
Created January 24, 2014 06:01
A smooth mobile menu transition for multiple nav options
// Requires
// jQuery JavaScript Library v1.10.2
// &
// jQuery Easing v1.3
$("a.menu").click(function(event) {
event.preventDefault();
var icon = $(this).find(".icon-menu");
if ($(icon).is(".open")) {
$(".menu,.sub-menu").slideUp(300, "easeInQuint");
@drocarmo
drocarmo / skygradient.scss
Last active January 4, 2016 07:59
Create a sky feeeeeel, ya feel?
$darkblue: #0C346B;
$lightblue: #1C7AFC;
@mixin gradient($from, $to) {
background-color: $from;
background: -moz-linear-gradient(top, $from 0%, $to 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,$from), color-stop(100%,$to));
background: -webkit-linear-gradient(top, $from 0%,$to 100%);
background: -o-linear-gradient(top, $from 0%,$to 100%);
}
@drocarmo
drocarmo / yeezy.js
Created January 24, 2014 06:06
Toggle Kanye West
$(".kanye").on("click", function() {
$(this).toggleClass("west");
});
@drocarmo
drocarmo / vertical_align.scss
Created January 24, 2014 06:11
Vertically align anythinggggg
// blog link: http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/
@mixin vertical-align {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
@drocarmo
drocarmo / clearfix.scss
Created January 24, 2014 06:13
Bourbbbbbbbbb
// Bourbon's clear-anything mixin
@mixin clearfix {
&:after {
content:"";
display:table;
clear:both;
}
}
@drocarmo
drocarmo / social.css
Last active August 29, 2015 13:57
Simple mixin to spits out specific social platform link styles. Just tie the class name to the markup. (example: http://drocarmo.com/)
/* Use-case output */
a.github {
color: #333333;
}
a.github:hover, a.github:active {
color: #1a1a1a;
}
a.rdio {
color: #006ed2;
// From @chriscoyier
// http://css-tricks.com/snippets/css/a-guide-to-flexbox/
@mixin flexbox() {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}