Skip to content

Instantly share code, notes, and snippets.

View delias's full-sized avatar
🖥️

Daniel Elias delias

🖥️
  • Sydney
View GitHub Profile
@delias
delias / ssh.md
Created February 1, 2019 07:10 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh brad@192.168.1.29

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@delias
delias / get_id
Created November 7, 2018 04:04 — forked from educartoons/get_id
const str = window.location.href ;
const regex = /\/chaplains\/([0-9]{1,5})/g;
const results = regex.exec(str);
const id = results[1];
function chaplains_init() {
global $wp,$wp_rewrite;
$wp_rewrite->add_rule('chaplains/([0-9]{4})/?$',
'index.php?pagename=mypage&id=$matches[1]', 'top');
// $wp_rewrite->flush_rules(false);
}
add_action('init','chaplains_init');
$.ajax({
url: ajaxfunction.ajaxurl,
type: 'post',
data: {
action: 'get_chaplains',
id: id, // por si vas a enviar variables
},
beforeSend: function(){
},
function my_enqueue_assets() {
wp_enqueue_script( 'ajax-function', get_stylesheet_directory_uri() . '/js/ajax-function.js', array(), '1.0.0', true );
wp_localize_script( 'ajax-function', 'ajaxfunction', array(
'ajaxurl' => admin_url( 'admin-ajax.php' )
));
}
my_enqueue_assets();