Skip to content

Instantly share code, notes, and snippets.

View educartoons's full-sized avatar

Eduar educartoons

View GitHub Profile
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();
$.ajax({
url: ajaxfunction.ajaxurl,
type: 'post',
data: {
action: 'get_chaplains',
id: id, // por si vas a enviar variables
},
beforeSend: function(){
},
{
"sgs": {
"type": "myself",
"diagnosis":"Alzheimer's disease",
"extendedInformation": [
{
"questionLabel": "What do you need help with?",
"answerLabel": "Adjusting to my recent dementia diagnosis"
},
{
const {
override,
getBabelLoader,
addWebpackModuleRule
} = require('customize-cra');
module.exports = (config, env) => {
const babelLoader = getBabelLoader(config);
return override(
@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;
}
@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 / 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 / bubbleSort.go
Created June 15, 2020 22:44
Implementation of Bubble Sort in Go
func bubbleSort(A []int) []int {
for i := 1; i < len(A); i++ {
for j := len(A) - 1; j >= i; j-- {
if A[j-1] > A[j] {
A[j-1], A[j] = A[j], A[j-1]
}
}
}
return A
@educartoons
educartoons / selection-sort.go
Created June 18, 2020 01:51
Implementation of Selection Sort in Go
func selectionSort(A []int) []int {
for i := 0; i < len(A)-1; i++ {
var min = i
for j := i + 1; j < len(A); j++ {
if A[j] < A[min] {
min = j
}
}
A[min], A[i] = A[i], A[min]
}
@educartoons
educartoons / selection-sort.ts
Created June 18, 2020 01:52
Implementation of Selection Sort in Typescript
function selectionSort(A: number[]): number[] {
for (let i = 0; i < A.length - 1; i++) {
let min = i;
for (let j = i + 1; j < A.length; j++) {
if (A[j] < A[min]) {
min = j;
}
}
[A[min], A[i]] = [A[i], A[min]]
}