Skip to content

Instantly share code, notes, and snippets.

View dreamorosi's full-sized avatar
👽

Andrea Amorosi dreamorosi

👽
View GitHub Profile
### Keybase proof
I hereby claim:
* I am dreamorosi on github.
* I am dreamorosi (https://keybase.io/dreamorosi) on keybase.
* I have a public key whose fingerprint is 6F38 5DC3 F136 96B6 C56E DCEA 3F7F 4C2A F62C A91D
To claim this, I am signing this object:
@dreamorosi
dreamorosi / standardJS-in-CRA.md
Last active August 16, 2022 17:33
Add Standard JS to create-react-app project

Standard JS in create-react-app

I've been using create-react-app lately as I find it very useful to kick things off while starting a project. I almost always follow JavaScript Standard Style and I found myself googling it so I figured out I should write it down.

Get Standard JS

I really like keeping dependencies as local as possible but if you prefer you can install it globally.

yarn add standard --dev

or

@dreamorosi
dreamorosi / distributionTest.js
Created March 23, 2017 22:47
Balance By CM - IDEA
var projects_current_status = [
{project: 'xxx', count: 1},
{project: 'yyy', count: 1},
{project: 'zzz', count: 1},
{project: 'aaa', count: 1}
]
var users_to_assign = 10
var cm_projects_users = [
@dreamorosi
dreamorosi / generators.md
Last active April 20, 2017 09:53
Javascript ES6 generators

Javascript ES6 generators

What is a generator?

Generators are functions that can be paused and resumed arbitrarily. The normal behavior of a Javascript function would be to execute its entire body when called. A generator's body instead can be divided in blocks of code that will be executed when a certain method is called on a generator's instance.

To create a generator we add an asterisk after the function keyword.

function* createLogger () {
  // your code
}
@dreamorosi
dreamorosi / templates_immobiliari.md
Created August 11, 2017 00:30
Templates Immobiliari
@dreamorosi
dreamorosi / microdata.md
Last active August 25, 2017 05:33
Microdata state of the art

Microdata

Intro

Schema.org (anche conosciuto come Schema) è un vocabolario di microdati composto da tag che possono essere inclusi nel markup HTML di una pagina per migliorarne il posizionamento nella SERP.

Schema.org nasce da uno sforzo congiunto di Google, Microsoft, Yandex e Yahoo! mirato a creare uno standard comune che permettesse ai motori di ricerca di comprendere il contenuto delle pagine web in modo da migliorare la qualità dei risultati mostrati ai propri utenti. Come già accennato, Schema.org è solo uno dei tanti vocabolari di dati strutturati che a loro volta possono essere espressi tramite la notazione microdata. I microdati vengono inseriti nell'HTML al fine di arricchire la pagina di metadati che permetteranno ai motori di ricerca di mostrare delle schede informative direttamente direttamente nei risultati della ricerca. La presenza dei microdati in se per se [pare non incidere i

Assignment 2

So the assignment consists of two main tasks:

  • Send to this API http://www.winelove.club/doc/html/testRestApi.php a json object containing all the data which have been typed inside your landing page web form, using Javascript + Ajax.
  • Create a dynamic list content in your personal project reading data from a locally stored json using Javascript + Ajax.

While doing the assignment you should also remember to:

  • Work on your local project and keep track of the changes with git.
  • Remember to start (npm start) or stop (ctrl + C) Sass while if you're making changes to the style/layout.
  • Indent your code in a consistent way.
  • Leave comments in the code whenever is needed.
@dreamorosi
dreamorosi / assignment_public.md
Last active December 12, 2017 09:45
Just some guidelines

Assignment 2

So the assignment consists of two main tasks:

  • Send to this API http://www.winelove.club/doc/html/testRestApi.php a json object containing all the data which have been typed inside your landing page web form, using Javascript + Ajax.
  • Create a dynamic list content in your personal project reading data from a locally stored json le using Javascript + Ajax.

While doing the assignment you should also remember to:

  • Work on your local project and keep track of the changes with git.
  • Indent your code in a consistent way.
  • Leave comments in the code whenever is needed.
@dreamorosi
dreamorosi / clean.sh
Last active April 27, 2018 01:20
Flask - Gunicorn - upstart socket API configuration
#!/bin/bash
sudo rm -rf /home/ec2-user/api
sudo rm /etc/nginx/conf.d/api.conf
sudo rm /etc/init/api.conf
echo "Done."
sudo reboot
@dreamorosi
dreamorosi / Readme.md
Last active April 6, 2023 15:22
Install and configure webserver based on nginx with php 7 and fpm over socket configured.

Install and configure webserver based on nginx with php 7 and fpm over socket configured plus a couple of utils.

While launching a new instance open the section Advanced details in step 3. Configure Instance paste this code that will clone this gist and run the install commands.

#!/bin/bash
yum install git -y
git clone https://gist.github.com/828861e850bbb14893ae144c28f39e0e.git /home/ec2-user/install
chmod a+x install/install.sh
bash /home/ec2-user/install/install.sh