Skip to content

Instantly share code, notes, and snippets.

View aziis98's full-sized avatar

Antonio De Lucreziis aziis98

View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
typedef struct node {
int label;
struct node * left;
struct node * right;
} Tree;
Tree *insert_tree(Tree *tree, int value) {
#include <stdio.h>
#include <stdlib.h>
typedef struct elemento{
int info;
struct elemento *next;
}Elemento;
typedef Elemento *Lista;
Node = {
Name = "Trim content"
// Tells the editor in which context this node can be used (in this case in a JS-targeted file)
Context = Javascript/Node
Inputs = {
contents = Text
mode = {
type = "Left", "Right", "Both"
default = "Both"
@aziis98
aziis98 / grammar-1.pegjs
Last active July 12, 2018 21:58
Grammar for my config language
// Aziis98 Data Grammar
// ==========================
//
{
function Symbol(text) {
this.__type__ = "Symbol";
this.text = text;
}
}

Glob

This node selects a group of files based on a pattern using the "glob" npm package.

Definition

Input Type
pattern Text
// Haskell-Like Type Syntax
// for Fragment Editor
// ========================
//
start
= Type
Type
= NamedType / ArrayType / ObjectType
const structuralReplace = (string, pattern, replacer) => {
if (typeof string === 'string') {
const acc = [];
let m;
let prevIndex = 0;
while (m = pattern.exec(string)) {
vec4 stroke(float distance, float linewidth, float antialias, vec4 stroke)
{
float t = linewidth / 2.0 - antialias;
float signed_distance = distance;
float border_distance = abs(signed_distance) - t;
float alpha = border_distance / antialias;
alpha = exp(-alpha * alpha);
if( border_distance < 0.0 )
@aziis98
aziis98 / basic-type-system-peg.js
Last active August 30, 2018 15:06
A simple PEGjs parser for a basic custom type system (Parses primitive types, generics (lowcase symbols), arrays (haskell way), functions (args are comma separated and after a right arrow there is a return type) and union types). Can be tried out here https://pegjs.org/online
// Copyright Antonio De Lucreziis 2018
/*
A simple PEGjs parser for a basic custom type system (Parses primitive types, generics (lowcase symbols), arrays (haskell way), functions (args are comma separated and after a right arrow there is a return type) and union types).
Can be tried out here https://pegjs.org/online
*/

Loading Bar Image

A prototype for an image with a progress bar that show the progress of download of the image.

Usage

First create an HeavyImage instance with the target URL and then place the internal element somewhere on the page using theImage.$element and when ready stard downloading the image with theImage.load().