Skip to content

Instantly share code, notes, and snippets.

View dospuntocero's full-sized avatar

Francisco arenas dospuntocero

View GitHub Profile
@dospuntocero
dospuntocero / use MAMPs php instead of system's
Last active May 31, 2019 02:12
use MAMPs php instead of system's
#first open the profile
mate ~/.bash_profile
- then add this 2 lines
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
- after that if you call which php, it must say something like
/Applications/MAMP/bin/php/php7.1.12/bin/php
@dospuntocero
dospuntocero / dospuntocerocms.php
Last active February 11, 2018 16:23
wordpress MEGALITE cms. for clients that don't need anything but blog or pages and you don't want them to mess things around. i'm using https://nestedpages.com/ for controlling the page tree. also added a small css for removing the regular editor links. added 2 useful functions: svg capability for uploading and removing thumbnail hardcode dimens…
<?php
/*
Plugin Name: dospuntocero
Plugin URI: -
Description: lite CMS
Author: Francisco Arenas
Version: 1
Author URI: http://dospuntocero.cl
@dospuntocero
dospuntocero / _masonry.scss
Created February 18, 2018 13:49
masonry layout for foundation 6 controlled by flexbox breakpoints. you need to add a masonry-container class to the parent and a masonry-item class to the child. the .grid-container class is optional
$masonry-css-column-gap: $global-margin;
$global-margin: 1rem !default;
.masonry-container {
column-count: 1;
column-gap: $masonry-css-column-gap;
@if ($flexbox-responsive-breakpoints) {
$i: 0;
@each $size in $breakpoint-classes {
@dospuntocero
dospuntocero / KNK C3 installation guide on macos using terminal:
Last active May 31, 2019 02:11
KNK C3 installation guide on macos using terminal:
there is a ultra faster way with less sotfware involved for macos
1st: diskutil list
2nd: diskutil unmountDisk /dev/diskn
3rd: sudo dd bs=1m if=the_force_image of=/dev/rdiskn
thats it. no other software needed.
@dospuntocero
dospuntocero / create symlinks
Last active May 31, 2019 02:11
create symlinks
@dospuntocero
dospuntocero / svg separator
Last active May 31, 2019 02:10
svg separator - in case you need to modify the vector you need to decode the base 64 object - https://www.tools4noobs.com/online_php_functions/base64_encode/
<div class="separator" style="
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSI4OXB4IiB2aWV3Qm94PSIwIDAgMTI4MCAxNDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI2Y2ZjdmOCI+PHBhdGggZD0iTTcyNS4yOSAxMDEuMkMzMjUuMjIgMTIyLjQ4IDAgMCAwIDB2MTQwaDEyODBWMHMtMTU0LjY0IDc5LjkyLTU1NC43MSAxMDEuMnoiIGZpbGwtb3BhY2l0eT0iLjMiLz48cGF0aCBkPSJNNTU2LjQ1IDExOS43NEM5NTMuNDEgMTQwIDEyODAgMTQgMTI4MCAxNHYxMjZIMFYwczE1OS41IDk5LjQ4IDU1Ni40NSAxMTkuNzR6IiBmaWxsLW9wYWNpdHk9Ii41Ii8+PHBhdGggZD0iTTY0MCAxNDBjMzUzLjQ2IDAgNjQwLTE0MCA2NDAtMTQwdjE0MEgwVjBzMjg2LjU0IDE0MCA2NDAgMTQweiIvPjwvZz48L3N2Zz4=);
height: 88px;
"></div>
@dospuntocero
dospuntocero / show page children wordpress
Last active May 31, 2019 02:10
show page children wordpress
<?php
$args = array(
'post_type' => 'page',
'posts_per_page' => -1,
'post_parent' => $post->ID,
'order' => 'ASC',
'orderby' => 'menu_order'
);
@dospuntocero
dospuntocero / even-odd.php
Created September 9, 2018 15:45
even odd classes on wordpress loop example on line 10 / 13
<?php
// WP_Query Arguments
$args = array(
'order' => 'DESC',
'posts_per_page' => 5
);
// The Loop
$query = new WP_Query( $args );
while ( $query->have_posts() ) : $query->the_post();
$even_odd_class = $wp_query->current_post % 2 == 0 ? 'even' : 'odd';
@dospuntocero
dospuntocero / even-odd for functions.php
Created September 9, 2018 16:02
add this function to your functions.php class and then add the filter to the result you need to have it.
function oddeven_post_class ( $classes ) {
global $current_class;
$classes[] = $current_class;
$current_class = ($current_class == 'odd') ? 'even' : 'odd';
return $classes;
}
add_filter ( 'post_class' , 'oddeven_post_class' );
global $current_class;
$current_class = 'odd';
@dospuntocero
dospuntocero / even odd inside foreach example
Created September 9, 2018 16:03
use this if you need a foreach with even/odd classes
<?php
$recent_posts = wp_get_recent_posts();
?>
<?php $current_class = 'odd';?>
<?php foreach( $recent_posts as $recent ):?>
<?php $current_class = ($current_class == 'odd') ? 'even' : 'odd'; ?>
<div class="<?php echo $current_class ?>">
<?php echo $recent["post_title"]?>
<a href="<?php echo get_permalink($recent["ID"])?>">READ MORE</a>