Skip to content

Instantly share code, notes, and snippets.

View pmcalabrese's full-sized avatar

Pachito Marco Calabrese pmcalabrese

View GitHub Profile
{
"version": 2,
"alias": ["tstc.now.sh"],
"builds": [
{ "src": "./build/**", "use": "@now/static"}
],
"routes": [
{ "src": "^/", "dest": "/build/index.html" },
{ "src": "^/favicon.ico", "dest": "/build/favicon.ico" },
{ "src": "^/static/(.*)", "dest": "/build/static/$1" }
@pmcalabrese
pmcalabrese / Makefile
Last active September 22, 2018 18:30
Makefile for Mbed OS 2
# Makefile for Mbed OS 2 \
After following the instruction here https://github.com/ARMmbed/mbed-cli#creating-a-new-program-for-mbed-os-2 \
Set GCC_ARM_PATH = "/Users/marco/opt/gcc-arm-none-eabi-7-2018-q2-update/bin" in the mbed_setting.py \
create a file called main.cpp in a folder called src \
edit TARGET and SERIAL_DEVICE_PATH accordingly and you are good to go \
you can dowload it with \
curl -Lo Makefile https://gist.github.com/pmcalabrese/638b1a443dac3547ba19d6e720a4449a/raw/Makefile
TARGET = NUCLEO_F042K6
SERIAL_DEVICE_PATH = /Volumes/MICROBIT
@pmcalabrese
pmcalabrese / getBEs.js
Last active September 22, 2018 18:32
Script that can run in the browser for extract user information (developed for Alessandro)
let usernames = ["alexeidos", "dilettaleotta"]
const pa = usernames.map((username) => {
return fetch("https://www.instagram.com/"+username+"/?__a=1")
.then((data) => { return data.json() })
.then((data) => { return `${data.graphql.user.full_name}, ${data.graphql.user.business_email}` })
})
Promise.all(pa).then((data) => {
console.log(data.join("\n"))
});
@pmcalabrese
pmcalabrese / Makefile
Last active January 31, 2019 13:44
Makefile for ZephyrOS Projects (only for mac)
# The intent of this Makefile is to facilitate the developing using ZephyrOS \
(on Mac), allows you to download the toolchain, compile and flash the project \
easly. \
\
Remember to source zephyr-env.sh from the zephyr folder or \
add . ~/dev/zephyr/zephyr-env.sh to your shall-resource file (.zshrc f exp.) \
\
The Makefile and the makefile.config need to be inside the project folder.\
You can download Makefile and the makefile.config with the following command:\
\
//...
new HtmlCriticalPlugin({
base: DIST_DIR,
src: 'index.html',
dest: 'index.html',
inline: true,
minify: true,
extract: true,
width: 1200,
height: 1200,
importScripts('workbox-sw.prod.v2.1.0.js');
/**
* DO NOT EDIT THE FILE MANIFEST ENTRY
*
* The method precache() does the following:
* 1. Cache URLs in the manifest to a local cache.
* 2. When a network request is made for any of these URLs the response
* will ALWAYS comes from the cache, NEVER the network.
* 3. When the service worker changes ONLY assets with a revision change are
#include "msp430.h"
/*
* Piedinatura
* 1.6 -> uscita PWM PP1
* 2.1 -> uscita PWM PP2
* 2.2 -> uscita PWM continua
* 1.0 -> uscita led lampeggiante in sync con 1.6
*/
//...
new workboxPlugin({
globDirectory: DIST_DIR,
globPatterns: ['**/*.{html,js,css}'],
swDest: path.join(DIST_DIR, 'sw.js'),
})
//...
...
{
test: /\.tsx?/i,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: {
presets: [
'es2015',
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">