Skip to content

Instantly share code, notes, and snippets.

View educartoons's full-sized avatar

Eduar educartoons

View GitHub Profile
@educartoons
educartoons / bubbleSort.ts
Last active June 15, 2020 22:52
Implementation of Bubble Sort in Typescript
function bubbleSort(A: number[]): number[] {
for (let i = 1; i < A.length; i++) {
for (let j = A.length - 1; j >= i; j--) {
if (A[j - 1] > A[j]) {
[A[j - 1], A[j]] = [A[j], A[j - 1]];
}
}
}
return A;
}
@educartoons
educartoons / insertion-sort.go
Last active June 15, 2020 04:29
Sorting by Insertion implemented in Go
func insertionSort(A []int) []int {
for j := 0; j < len(A); j++ {
var key = A[j]
var i = j - 1
for i >= 0 && A[i] > key {
A[i+1] = A[i]
i = i - 1
}
A[i+1] = key
@educartoons
educartoons / insertion-sort.ts
Last active June 15, 2020 04:30
Sorting by Insertion implemented in Typescript
function insertionSort(A: number[]): number[] {
for (let j = 1; j < A.length; j++) {
let key = A[j];
let i = j - 1;
while (i >= 0 && A[i] > key) {
A[i + 1] = A[i];
i = i - 1;
}
A[i + 1] = key;
}
const {
override,
getBabelLoader,
addWebpackModuleRule
} = require('customize-cra');
module.exports = (config, env) => {
const babelLoader = getBabelLoader(config);
return override(
{
"sgs": {
"type": "myself",
"diagnosis":"Alzheimer's disease",
"extendedInformation": [
{
"questionLabel": "What do you need help with?",
"answerLabel": "Adjusting to my recent dementia diagnosis"
},
{
$.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();
@educartoons
educartoons / get_id
Last active November 7, 2018 04:04
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');
.blog-ul-list {
margin: 0;
padding: 0;
}
.blog-entry {
background-color: #13161a;
list-style: none;
width: 49.15254%;
float: left;