Skip to content

Instantly share code, notes, and snippets.

View jorgepinon's full-sized avatar

Jorge Luis Piñon jorgepinon

View GitHub Profile
@jorgepinon
jorgepinon / .htaccess
Created August 29, 2012 03:45 — forked from kevinthompson/.htaccess
ExpressionEngine Rewrite Rules
<IfModule mod_rewrite.c>
# Enable Rewrite Engine
# ------------------------------
RewriteEngine On
RewriteBase /
# Redirect index.php Requests
# ------------------------------
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
@jorgepinon
jorgepinon / gist:3506612
Created August 29, 2012 03:48
ExpressionEngine htaccess exclude list method
RewriteEngine On
# exclude list method: http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method
RewriteCond $1 !^(admin|css|images|js|templates|themes|uploads|favicon\.ico|robots\.txt|index\.php|googleWebmasterFile\.html|sitemap\.html) [NC]
RewriteRule ^(.*)$ index.php?/$1 [L]
@jorgepinon
jorgepinon / organictabs-minHeight.jquery.com
Created September 9, 2012 15:43
@chriscoyier's organic-tabs with minHeight added
// Thanks to Chris Coyier: http://css-tricks.com/organic-tabs/
// I added a quick minHeight option and a check for it on line 50
(function($) {
$.organicTabs = function(el, options) {
var base = this;
base.$el = $(el);
base.$nav = base.$el.find(".nav");
@jorgepinon
jorgepinon / gist:3719599
Created September 14, 2012 03:19
get local forecast using YQL via ajax
var query = escape('select item from weather.forecast where woeid=2450080'),
url = "http://query.yahooapis.com/v1/public/yql?q=" + query + "&format=json&callback=w";
$.ajax({
url: url,
dataType: 'jsonp',
jsonpCallback: 'w',
success: function(data) {
var cond = {
text: data.query.results.channel.item.condition.text,
@jorgepinon
jorgepinon / gist:3722178
Created September 14, 2012 14:18
module - responsive banner with multiple flexslider carousels
<!--
uses jQuery FlexSlider v2.1
by Tyler Smith ((@mbmufffin)
-->
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title></title>
@jorgepinon
jorgepinon / nav-styles-responsive.html
Last active December 15, 2015 09:19
A CodePen by Jorge Luis Piñon. 3 .nav types, with togglers - .nav .nav--pills (extends .nav) .nav--stacked (extends .nav) For small screens a toggle link appears that expands an each navigation. TODO: method to alternate nav types repsonsively. For example, nav--stacked becomes nav--pills at a given breakpoint
<h2>3 Nav styles (with Toggling)</h2>
<ul>
<li>.nav (basic, horizontal list of links with padding for tap targets)</li>
<li>.nav-pills (extends nav, defined backgrounds, spaced)</li>
<li>.nav--stacked (extends nav, windowshade)</li>
</ul>
<p>For "major" navigation (like site-wide), the UL should be wrapped in a NAV element. Toggle links (".nav-link") should then be added as first child of NAV, sibling to UL.</p>
<p>Toggle links appear at small screen sizes.</p>
@jorgepinon
jorgepinon / alert.js
Last active December 15, 2015 12:38
A tiny jquery plugin that adds a close link to an alert div
(function($){
$.fn.extend({
//pass the options variable to the function
alert: function(options) {
//Set the default values
var defaults = {
pull: 'right',
@jorgepinon
jorgepinon / fadeOut + remove
Last active December 26, 2015 02:29
jQuery fadeOut and remove plugin
$.fn.fadeOutAndRemove = function(speed){
$(this).fadeOut(speed,function(){
$(this).remove();
})
}
// use like $('div').fadeOutAndRemove(200);
@jorgepinon
jorgepinon / JSON obj to Array
Created December 13, 2013 07:17
create an array of objects from a JSON object (useful for harpjs _data.json)
var dataJson = {},
dataArray = [];
// assuming a JSON structure like this:
dataJson = {
"key1": {
"prop1": "val1",
"prop2": "val2"
},
@jorgepinon
jorgepinon / drawer
Last active August 29, 2015 13:56
slideDown drawer module (html, scss, jquery)
// TODO: add keyboard listeners and aria attributes (expanded, haspopup)
/////////////////////////
////// HTML
///////////////
<div class="drawer trigger-drawer-open is-drawer-closed">
<div class="drawer-hd">
<span class="pull-left" data-target="drawer-bd"><span class="icon--arrow--closed"></span></span>
<h3 class="drawer-title">Drawer header indicates drawer-bd content</h3>