Skip to content

Instantly share code, notes, and snippets.

View rokity's full-sized avatar
🏠
Working from home

Riccardo Amadio rokity

🏠
Working from home
View GitHub Profile
@rokity
rokity / dataclass.py
Created October 3, 2023 15:51
DataClasses+Decorator+Metadata
from dataclasses import dataclass, field
@dataclass
class SalesData:
sales_figures: list = field(metadata={"description": "List of sales figures"})
date: str = field(metadata={"description": "Date of the sales data"})
region: str = field(metadata={"description": "Sales region"})
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var assert = require('assert')
console.log('\n===========');
console.log(' mongoose version: %s', mongoose.version);
console.log('========\n\n');
var dbname = 'testing_geojsonPoint';
@rokity
rokity / index.js
Created September 5, 2017 06:45
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
var each = require('foreach-then');
var numbers = [1,2,3];
each(numbers,
(item,index,array) =>
{
//iterate-function
@rokity
rokity / index.js
Last active September 5, 2017 06:41
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
var numbers = [1,2,3];
numbers.forEach(
(item,index,array)=>
{
//iterate-function
if(array.length-1==index)
@rokity
rokity / hapiExample.js
Created September 3, 2017 12:46 — forked from nvcexploder/hapiExample.js
basic hapi.js example highlighting HTTP methods and a few request parameters
/*
For this to run, ensure that `npm install hapi` has happened in your directory
setup whilst writing this:
iojs v. 1.0.5
hapi 8.2.0
*/
var Hapi = require('hapi');