Skip to content

Instantly share code, notes, and snippets.

View carlozamagni's full-sized avatar
🎯
Focusing

Carlo Zamagni carlozamagni

🎯
Focusing
  • Technogym
  • Bologna
View GitHub Profile
class Person {
constructor({ firstName, lastName }) {
this.firstName = firstName || 'John';
this.lastName = lastName || 'Doe';
}
getFullName() {
return this.firstName + ' ' + this.lastName;
}
}
class Person {
constructor(props) {
this.firstName = props.firstName || 'John';
this.lastName = props.lastName || 'Doe';
}
getFullName() {
return this.firstName + ' ' + this.lastName;
}
}
function Person(props) {
this.firstName = props.firstName;
this.lastName = props.lastName;
}
Person.prototype.getFullName = function() {
return this.firstName + ' ' + this.lastName;
}
@carlozamagni
carlozamagni / double.py
Created February 26, 2016 07:58
Python support for IEEE 754 double-precision floating-point numbers.
# double.py
# Copyright (C) 2006, 2007 Martin Jansche
#
# 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, distribute with modifications, 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:
// This #include statement was automatically added by the Particle IDE.
#include "MQTT/MQTT.h"
// This #include statement was automatically added by the Spark IDE.
#include "Adafruit_DHT/Adafruit_DHT.h"
#define DHTPIN 2 // pin
#define DHTTYPE DHT11 // DHT 11
@carlozamagni
carlozamagni / express.js
Created January 13, 2016 21:21 — forked from azat-co/express.js
Tutorial: REST API with Node.js and MongoDB using Mongoskin and Express.js
var express = require('express')
, mongoskin = require('mongoskin')
var app = express()
app.use(express.bodyParser())
var db = mongoskin.db('localhost:27017/test', {safe:true});
app.param('collectionName', function(req, res, next, collectionName){
req.collection = db.collection(collectionName)
@carlozamagni
carlozamagni / Spark-Uptime.cpp
Created November 14, 2015 17:57 — forked from wgbartley/Spark-Uptime.cpp
Spark-Uptime
char srvIP[] = "256.256.256.256";
char srvHost[] = "myhost.mydomain.tld";
int srvPort = 80;
char srvPath[] = "/?l=test1";
void setup() {
delay(5000);
pinMode(D7, OUTPUT);
@carlozamagni
carlozamagni / swift_package_merger.py
Last active October 22, 2015 15:58
Merges auto generated code from multiple files into a single swift class
import os
__author__ = 'carlozamagni'
BASE_PATH = os.getcwd()
def merge_files(path, package_name):
files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path,f))]
@carlozamagni
carlozamagni / .Title
Last active September 20, 2015 19:45 — forked from congjf/.Title
Using MongoDB in golang with mgo
Using MongoDB in golang with mgo
@carlozamagni
carlozamagni / LICENSE
Last active September 18, 2015 12:59 — forked from kesor/LICENSE
Making Amazon AWS API Queries
Copyright (c) 2013, Evgeny Zislis
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,