Skip to content

Instantly share code, notes, and snippets.

View aziis98's full-sized avatar

Antonio De Lucreziis aziis98

View GitHub Profile
const express = require('express');
const htm = require('htm');
const vhtml = require('vhtml');
// create an html`` tag function for vhtml:
const html = htm.bind(vhtml);
const App = (props) => html`
<div class="app">
<h1>This is an app</h1>
@aziis98
aziis98 / !README.md
Last active May 25, 2020 23:55
Mio template per le cose in LaTeX.

LaTeX Template

Perché è sempre cosa buona e giusta mettere i README:

  • Font: Linux Libertine
  • Geometry: Margine di soli 30mm
  • Section: Linee sotto le section
  • Babel: Supporto per l'italiano
@jameslaneconkling
jameslaneconkling / baby-lisper.js
Last active August 23, 2022 00:32
A silly simple lisp parser in javascript
const rules = [
{ type: 'space', regex: /^\s/ },
{ type: 'lParen', regex: /^\(/ },
{ type: 'rParen', regex: /^\)/ },
{ type: 'number', regex: /^[0-9\.]+/ },
{ type: 'string', regex: /^".*?"/ },
{ type: 'variable', regex: /^[^\s\(\)]+/ } // take from the beginning 1+ characters until you hit a ' ', '(', or ')' // TODO - support escaped double quote
];
@shospodarets
shospodarets / Chrome headless Puppeteer- capture DOM element screenshot using
Last active July 29, 2024 05:58
Chrome headless Puppeteer- capture DOM element screenshot using
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Adjustments particular to this page to ensure we hit desktop breakpoint.
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1});
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'});
@aziis98
aziis98 / LICENSE
Created August 9, 2017 00:20
Template of Webpack with Sass
MIT License
Copyright (c) 2017 Antonio De Lucreziis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@preslavrachev
preslavrachev / kotlin-gradle-executable-jars.md
Created December 10, 2016 07:29
Kotlin Basics: Create Executable Kotlin JARs, using Gradle

Kotlin Basics: Create Executable Kotlin JARs, using Gradle

Kotlin is great for creating small command-line utilities, which can be packaged and distributed as normal JAR files. This short tutorial will show you how to:

  • Set up a Gradle project that supports Kotlin
  • Add a starting function
  • Configure your build to call this function when you execute your JAR.

Setting up Kotlin dependencies

@halgari
halgari / gist:f431b2d1094e4ec1e933969969489854
Last active May 11, 2024 02:23
What I want from a Type System
The question was asked why I (as a programmer who prefers dynamic languages) don't consider static types "worth it". Here
is a short list of what I would need from a type system for it to be truely useful to me:
1) Full type inference. I would really prefer to be able to write:
(defn concat-names [person]
(assoc person :full-name (str (:first-name person)
(:second-name person))))
And have the compiler know that whatever type required and produced from this function was acceptible as long as the
@aziis98
aziis98 / PocketBinder.js
Last active August 16, 2016 23:18
A small library that adds a template engine and a one way binding mechanism. All in about 100 lines of code. (TODO: Add list/objects iterators)
/*
A small library that adds a template engine and a one way binding mechanism. All in 200 lines of code.
*/
@jcgregorio
jcgregorio / How_to_use.html
Last active July 17, 2023 14:44
HTML Templating using the HTML <template> element and exactly 100 lines of JS. A cleaned up version of this code is now available at https://github.com/jcgregorio/stamp/.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script src="templating.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<template id=t>
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active May 20, 2024 11:27
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');