Skip to content

Instantly share code, notes, and snippets.

View juanmaguitar's full-sized avatar

JuanMa juanmaguitar

View GitHub Profile
@juanmaguitar
juanmaguitar / fibonacciNth.js
Last active September 12, 2016 11:07
JS:fibonacciNth
function fibonacciNth ( position ) {
switch (position) {
case 0:
return -1;
case 1:
return 0;
case 2:
return 1;
default:
return fibonacciNth(position-1)+fibonacciNth(position-2);
@juanmaguitar
juanmaguitar / functions.php
Last active October 6, 2019 09:34
Disable endpoints Wordpress API
/* ---- endpoints API ---- */
function disableAllEndpoints( $endpoints ){
foreach ($endpoints as $clave => $valor) {
unset( $endpoints[$clave] );
}
return $endpoints;
}
@juanmaguitar
juanmaguitar / index.html
Created June 4, 2016 09:34
Angular Bootstrap jQuery boilerplate
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Document</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap -->
@juanmaguitar
juanmaguitar / invite-all.js
Created April 13, 2016 15:43
facebook "invitar a amigos"
var buttons = document.querySelectorAll(".fbProfileBrowserListItem .uiButton")
for (var i=0; i<buttons.length; i++) {
$(buttons[i]).click();
}
@juanmaguitar
juanmaguitar / add-subdomain.sh
Last active July 19, 2024 18:41
Local Wordpress Multisite Trellis Installation
#!/usr/bin/env bash
# Config Variables
args=("$@")
SUBDOMAIN_KEY=${args[0]}
source ../site/.env
sudo sh -c "echo '192.168.50.5 $SUBDOMAIN_KEY.$DOMAIN_CURRENT_SITE' >> /etc/hosts"
@juanmaguitar
juanmaguitar / debug-hooks.php
Created March 22, 2016 16:40
debug hooks wordpress
<?php
/* From => http://www.rarst.net/wordpress/debug-wordpress-hooks/ */
function dump_hook( $tag, $hook ) {
ksort($hook);
echo "<pre>>>>>>\t$tag<br>";
foreach( $hook as $priority => $functions ) {

English (programming) symbol names

  • [] brackets
  • () parentheses, round brackets
  • {} curly braces
  • <> chevrons, angle brackets
  • ; semi-colon
  • : colon
  • . period, dot
  • , comma
@juanmaguitar
juanmaguitar / frontend-bookmarks.md
Created March 7, 2016 09:01
frontend bookmarks
@juanmaguitar
juanmaguitar / inheritance.js
Created February 10, 2016 20:11
javascript-examples
var Person = function(x){
if(x){this.fullName = x};
};
Person.prototype.whatIsMyFullName = function() {
return this.fullName;
}
var cody = new Person('cody lindley');
var lisa = new Person('lisa lindley');
console.log(cody.whatIsMyFullName(), lisa.whatIsMyFullName());
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
# Shamelessly copied from https://github.com/gf3/dotfiles
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi
if tput setaf 1 &> /dev/null; then