Skip to content

Instantly share code, notes, and snippets.

View alvaromartinezmajado's full-sized avatar

Álvaro Martínez Majado alvaromartinezmajado

View GitHub Profile
@alvaromartinezmajado
alvaromartinezmajado / wpdb_default_tables.sql
Created April 30, 2021 01:27 — forked from rnagle/wpdb_default_tables.sql
Default WordPress Database Table Create Statements
DROP TABLE IF EXISTS wp_users;
CREATE TABLE wp_users (
ID bigint(20) unsigned NOT NULL auto_increment,
user_login varchar(60) NOT NULL default '',
user_pass varchar(64) NOT NULL default '',
user_nicename varchar(50) NOT NULL default '',
user_email varchar(100) NOT NULL default '',
user_url varchar(100) NOT NULL default '',
user_registered datetime NOT NULL default '0000-00-00 00:00:00',
user_activation_key varchar(60) NOT NULL default '',
while sleep 2; do echo foo; done >> /tmp/log.txt &
disown
tail -f /tmp/log.txt
#ara es pot tancar el terminal
@alvaromartinezmajado
alvaromartinezmajado / explicaio.js
Last active January 10, 2020 13:09
Explicació
// creo una variable que es diu "element"
let element = "Hola";
// creo una funció que també es diu "element"
function element() {
return "Bon dia";
}
console.log(element); // Això, sense els parèntesi, fa sortir "Hola" a la consola
console.log(element()); // això, amb els parèntesi, fa sortir "Bon dia" a la consola
@alvaromartinezmajado
alvaromartinezmajado / README.md
Created December 9, 2017 13:27 — forked from afeld/README.md
Twitter bio search

A friend is looking for a new tech job and asked if I knew anyone at a handful of companies. I'm (meaningfully) connected to more people who are relevant to this on Twitter than LinkedIn, so figured it would be easiest to scour people's bios. Naturally, I did this in the nerdiest way possible and automated it.

<3 @aidanfeldman

P.S. See also:

@alvaromartinezmajado
alvaromartinezmajado / helpers.php
Created February 12, 2017 03:06 — forked from mabasic/helpers.php
config_path function for Lumen framework
<?php
if ( ! function_exists('config_path'))
{
/**
* Get the configuration path.
*
* @param string $path
* @return string
*/
@alvaromartinezmajado
alvaromartinezmajado / service-workers.md
Created December 4, 2016 17:08 — forked from Rich-Harris/service-workers.md
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@alvaromartinezmajado
alvaromartinezmajado / mkgif.sh
Created September 14, 2016 14:42 — forked from kdzwinel/mkgif.sh
Making gifs from mov files on OS X. Requirements: ffmpeg and gifsicle (both available via brew).
#!/bin/bash
FILE=$1
if [ ! -f "$FILE" ]; then
echo "File not found!"
exit 1
fi
mkdir ./pngs
mkdir ./gifs
@alvaromartinezmajado
alvaromartinezmajado / Wordpress Bootstrap 3 nav.php
Created September 5, 2016 16:45 — forked from jfitzsimmons2/Wordpress Bootstrap 3 nav.php
How to structure your WP <nav> tag using wp_nav_menu to use Bootstrap 3's navbar. Note this is specifically for the "fixed top" version of the navbar (http://getbootstrap.com/components/#navbar-fixed-top). Also only works for single-level navs. If there are sub-menus, additional tweaking is needed.
<nav id="site-navigation" class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><?php bloginfo( 'name' ); ?></a>
@alvaromartinezmajado
alvaromartinezmajado / redirect-old-urls.php
Created June 11, 2016 21:11 — forked from mikeschinkel/redirect-old-urls.php
WordPress plugin to redirect old URLs when a site is refreshed. Uses a JSON file on activate to import into the DB. If Activation fails because of an error in the JSON file just deactivate, edit the file and then reactivate.
<?php
/**
* Plugin Name: Redirect Old URLs
* Description: Supports redirecting from an old site's URL to a new site on same domain.
* Version: 0.1.0
* Author: The WPLib Team
* Author URI: http://github.com/wplib
* Author Email: team@wplib.org
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@alvaromartinezmajado
alvaromartinezmajado / 0_reuse_code.js
Created April 7, 2016 16:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console