Skip to content

Instantly share code, notes, and snippets.


Francisco arenas dospuntocero

View GitHub Profile
View installing rails 6 on debian
sudo apt install ruby
sudo apt install rbenv
sudo apt install ruby-railties
sudo apt install ruby-dev
sudo gem install rails -v 6.0.0
rbenv rehash
rails -v
dospuntocero / setup.php
Created May 1, 2020
remove main editor wordpress
View setup.php
add_action( 'init', function() {
remove_post_type_support( 'page', 'editor' );
}, 10);
dospuntocero /
Created Mar 25, 2020
how to create a symlink in windows
dospuntocero / gist:656294ac763085cba4b0b005f27a5166
Created Mar 7, 2020
“Parsing filters unsupported” error during extraction of RAR file - FIX Ubuntu
View gist:656294ac763085cba4b0b005f27a5166
in terminal:
sudo apt-get install unrar
sudo apt-get install unar
Then for using with archive manager: sudo apt-get install file-roller
dospuntocero / article.php
Created Feb 26, 2020
cutting the title and content for showing even smaller excerpts they they dont fit in the design
View article.php
<div class="cell medium-4">
<div class="media__teaser">
<p class="media__teaser--type">
<?php echo get_the_category()[0]->name; ?>
<div class="media__teaser--title">
<?php echo mb_strimwidth(get_the_title(), 0, 50, '...'); ?>
dospuntocero /
Last active Apr 22, 2020 — forked from sageworksstudio/
Ubuntu 18.04 LAMP setup

First create an ssh key

ssh-keygen -t rsa -C "your email"

Ubuntu 18.04 LAMP setup

SECURITY FIRST: Add a sudo user, require public key authentication and disable root login

Log into the remote machine as root: ssh root@

First, add the admin user.

dospuntocero /
Last active Feb 23, 2020
Running MacOS on Debian/Ubuntu/Pop_OS!

If you want to experiment with a MacOS system and use GNU/Linux on your machines, then it’s actually quite simple to setup a virtual instance of MacOS on VirtualBox. Instead of looking for a Hackintosh image, I tried using a Vagrant image and was able to boot into MacOS within minutes.

  1. Prerequisites

    Install VirtualBox from VirtualBox’s download page Install additional dependencies: sudo apt-get install virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms

    Setup Vagrant by downloading the appropriate Vagrant DEB package from Vagrant’s download page

  2. Meat

dospuntocero /
Created Jan 26, 2020 — forked from cobyism/
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

View gist:1529a75fdd0f98175a5bd4d5d0ab36a5
namespace Roots\Sage\Nav;
use Roots\Sage\Utils;
* Cleaner walker for wp_nav_menu()
* Walker_Nav_Menu (WordPress default) example output:
dospuntocero / super-clean-wp-menu.php
Last active Jan 4, 2020
from time to time you need to completely change the way a menu markup is displayed and the walker class is a pain. you can just use this procedural function and add classes or markup you need
View super-clean-wp-menu.php
function clean_custom_menus() {
$menu_name = 'nav-primary'; // specify custom menu slug
if (($locations = get_nav_menu_locations()) && isset($locations[$menu_name])) {
$menu = wp_get_nav_menu_object($locations[$menu_name]);
$menu_items = wp_get_nav_menu_items($menu->term_id);
$menu_list = '<nav>';
$menu_list .= '<ul>';
foreach ((array) $menu_items as $key => $menu_item) {
$title = $menu_item->title;
You can’t perform that action at this time.