Skip to content

Instantly share code, notes, and snippets.

View rudasn's full-sized avatar

Nicolas Rudas rudasn

View GitHub Profile
@rudasn
rudasn / generate-docusaurus-sidebar.js
Created November 15, 2020 08:58
Generate docusaurus sidebar from folder structure
//
// Generates a sidebar based on file structure and
// markdown frontmatter properties.
//
// ---
// title: My Cool Feature
// sidebar_label: Introduction
// ---
//
// sidebar_sort_order: the sort order of this page in the sidebar
@rudasn
rudasn / jdom-data-structure.js
Created October 3, 2013 10:55
A simple representation of DOM elements in JSON format.
// An image
{
"type": "img",
"attrs": {
"src": "helloworld.jpg",
"height": 200,
"width": 200
}
}
@rudasn
rudasn / gist:1047516
Created June 26, 2011 10:57
Parallel, sequential ajax requests
function Parallel(oncomplete){
return {
'__requests__': [],
'__responses__': [],
'__completed__': 0,
'ajax': function(ajax_props) {
var self = this,
complete = $.isFunction(ajax_props.complete) ? ajax_props.complete : function() {},
success = $.isFunction(ajax_props.success) ? ajax_props.success : function() {},
count = this.__requests__.length;