Skip to content

Instantly share code, notes, and snippets.

View dsebao's full-sized avatar
🏠
Working from home

Sebastian Ortiz dsebao

🏠
Working from home
View GitHub Profile
@dsebao
dsebao / mailchimp.php
Created June 30, 2014 13:42
Mailchimp API Wrapper
<?php
namespace Drewm;
/**
* Super-simple, minimum abstraction MailChimp API v2 wrapper
*
* Uses curl if available, falls back to file_get_contents and HTTP stream.
* This probably has more comments than code.
*
@dsebao
dsebao / index.html
Last active July 26, 2017 17:43
Tabbed content with jQuery
<ul id="navtab" class="clearfix">
<li><a href="">link1</a></li>
<li><a href="">link2</a></li>
<li><a href="">link3</a></li>
</ul>
<div id="contenttab">
<div>
Contenido 1
</div>
@dsebao
dsebao / functions.php
Created July 3, 2014 15:57
Crop images from the top in WordPress
<?php
/*
*
*
* Crop from the top
*
*
*/
function my_awesome_image_resize_dimensions( $payload, $orig_w, $orig_h, $dest_w, $dest_h, $crop ){
@dsebao
dsebao / tags.html
Last active May 20, 2016 18:55
MailChimp Template Tags
Asunto
*|MC:SUBJECT|*
Link a ver online el news
*|ARCHIVE|*
<!-- Aplicable a imagenes, p, span, divs -->
mc:edit="section-name"
<!-- Si esta aplicado a imagenes se recomienda ajustar el width -->
@dsebao
dsebao / functions.php
Last active February 26, 2021 15:00
Create OptGroups for select dropdown (categories) in WordPress using selectize plugin
<?php
class Top_level_Optgroup extends Walker_CategoryDropdown {
var $optgroup = false;
function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
$pad = str_repeat('&nbsp;', $depth * 3);
@dsebao
dsebao / functions.php
Created August 8, 2014 13:55
Dynamic navigation jquery + php
<?php
// detect a localhost of a domain up
$weblocal = 'folderweb/'; //localhost folder
$server = $_SERVER['SERVER_NAME'];
if(strstr($server, '192.168.1.10') || strstr($server, 'localhost')){
$url = "http://" . $_SERVER['SERVER_NAME'] . "/" . $weblocal;
} else {
$url = "http://" . $_SERVER['SERVER_NAME'] . "/";
@dsebao
dsebao / script.js
Created September 16, 2014 18:45
Move the image background jquery+css
$('#landing-content').mousemove(function(e){
var amountMovedX = (e.pageX * -1 / 6);
var amountMovedY = (e.pageY * -1 / 6);
$(this).css('background-position', amountMovedX + 'px ' + amountMovedY + 'px');
});
@dsebao
dsebao / functions.php
Created November 11, 2014 15:01
Load custom template for categories in single post - WordPress
<?php
function get_custom_cat_template($single_template){
global $post;
if ( in_category( 'movies' )) {
$single_template = dirname( __FILE__ ) . '/single-movies.php';
}
return $single_template;
}
@dsebao
dsebao / plugin.js
Created November 18, 2014 02:16
jQuery Plugin Boilerplate
(function($) {
$.fn.helloWorld = function() {
this.each( function() {
/*Some shit*/
$(this).text("Hello, World!");
});
}
}(jQuery));
@dsebao
dsebao / info.php
Created November 18, 2014 13:06
Moving WordPress - Steps to follow
<?php
//wp-config.php
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'mydomain.com' );
define( 'PATH_CURRENT_SITE', '/' );
//SQL commands
UPDATE wp_posts SET guid = REPLACE (guid,