Skip to content

Instantly share code, notes, and snippets.

View alexanmtz's full-sized avatar
🎯
Focusing

Alexandre Magno alexanmtz

🎯
Focusing
View GitHub Profile
@alexanmtz
alexanmtz / layout-sidebar-adapt.scss
Created February 5, 2017 16:43
Example of a navigation in two columns adapted to a mobile overlay vertical navigation
@media screen and (max-width: 480px) {
html {
.main {
width: 100%;
}
.trigger-overlay-container {
display: block;
}
.sidebar .close {
display: block;
@alexanmtz
alexanmtz / wordpress-plugin-svn-to-git.md
Last active June 16, 2016 01:57 — forked from kasparsd/wordpress-plugin-svn-to-git.md
Using Git with Subversion Mirroring for WordPress Plugin Development
<?xml version="1.0" encoding="UTF-8"?>
<yahoo-weather-codes>
<code number="0" description="tornado"/>
<code number="1" description="tropical storm"/>
<code number="2" description="hurricane"/>
<code number="3" description="severe thunderstorms"/>
<code number="4" description="thunderstorms"/>
<code number="5" description="mixed rain and snow"/>
<code number="6" description="mixed rain and sleet"/>
<code number="7" description="mixed snow and sleet"/>
@alexanmtz
alexanmtz / jquery_basic_plugin.js
Created July 24, 2012 00:31
A basic jQuery plugin file
;(function ( $, window, document, undefined ) {
// Create the defaults once
var pluginName = 'defaultPluginName',
defaults = {
propertyName: "value"
};
// The actual plugin constructor
function Plugin( element, options ) {
@alexanmtz
alexanmtz / validate_maior_que_dezoito.js
Created July 11, 2012 03:03
Novo método do validate
// Metodo para validar se a pessoa tem mais de 18 anos, ela serve para ilustrar como usar o addMethod para criar qualquer regra de validação
jQuery.validator.addMethod("minAge", function(value, element, params) {
return this.optional(element) || value &gt; params;
}, "Você precisa ter mais de 18 anos.");
@alexanmtz
alexanmtz / jquery_destaque_queue.js
Created June 25, 2012 17:49
jQuery Destaque Queue Component
$('.triple-slides').destaquesQueue({
delay: 250,
// same options that destaque plugin but for multiple elements queue, the pagination handler and mouse interactions will control all slides as single to have the desired effect
controlsSelector: "#slide-triple-pagination a",
stopOnMouseOver: true,
slideMovement: 100,
slideSpeed: 1000,
autoSlideDelay: 3000,
elementSpeed: 1100,
easingType: "easeInOutExpo",
@alexanmtz
alexanmtz / sliding_onappend_example.js
Created June 24, 2012 20:32
jQuery Sliding using onAppend to change data from server
$('element').sliding({
items: 4,
url: url,
urlFormat: '{url}/page/{page}/',
next: nextLink,
prev: prevLink,
disabledClass: 'disabled',
speed: 500,
onAppend: function(data) {
// data is { total_pages: 2, html: 'content' }
@alexanmtz
alexanmtz / markup_sliding_live_example.html
Created June 23, 2012 18:20
Markup of sliding living example
<form class="well custom-init">
<label for="option">Items</label>
<input type="text" placeholder="items to display" class="input-medium option-item" name="option-item">
<label for="option">Current page</label>
<input type="text" placeholder="default is 1" class="input-medium option-currentPage" name="option-currentPage">
<label for="option-autoHeight">autoHeight</label>
<select class="option-autoHeight" name="option-autoHeight">
@alexanmtz
alexanmtz / sliding_options_example.js
Created June 23, 2012 18:18
Sliding options example
$(function(){
$('.live-pagination').hide();
$('.custom-init').submit(function(e){
var items = $('.option-item').val();
var autoHeight = $('.option-autoHeight').val();
var currentPage = $('.option-currentPage').val();
var element = $('.slide-live-example').sliding({
@alexanmtz
alexanmtz / wordpress_agenda_template.php
Created June 22, 2012 01:33
A agenda template for wordpress
<?php get_header(); ?>
<!-- main content -->
<div class="main-content grid_16">
<div class="grid_12">
<h2>Eventos</h2>
<div id="wp-agenda-calendar"></div>
</div>
</div>
<?php get_footer(); ?>