Skip to content

Instantly share code, notes, and snippets.

@stormsson
stormsson / emon.ino
Created August 23, 2018 22:04
Arduino energy monitor SCT-0130-030
//Arduino Misuratore di potenzza e corrente elettrica con SCT-013-030
//use EmonLib
// https://www.progettiarduino.com/76-arduino-amperometro-con-sct-013-corrente-e-potenza.html
#include "EmonLib.h"
#include <Wire.h> // Libreria wire già presente in Arduino ide
import keras
import numpy as np
from keras.applications import vgg16, inception_v3, resnet50, mobilenet
#Load the VGG model
vgg_model = vgg16.VGG16(weights='imagenet')
#Load the Inception_V3 model
inception_model = inception_v3.InceptionV3(weights='imagenet')
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "Ten.h"
#include "TenBlock.h"
#include "TenBlockGrid.h"
ATenBlock::ATenBlock()
{
// Structure to hold one-time initialization
struct FConstructorStatics
@stormsson
stormsson / protract.sh
Created November 10, 2015 16:36
protract folder
#!/bin/bash
function createStructure {
if [ -f default_conf.js ]; then
echo -ne 'Structure already found, aborting'
else
echo 'Structure not found, creating...'
wget https://github.com/stormsson/protractor_scaffolding/archive/master.zip &&
unzip master &&
rm master.zip &&
@stormsson
stormsson / config_with_memcache_sesssion.yml
Last active April 5, 2017 05:04
Symfony2 Session management
# app/config.yml
framework:
...
session:
handler_id: %session_handler_id% # read from parameters.yml
#handler_id: session.handler.memcache # use service defined later
services:
# MEMCACHE SESSION MANAGEMENT SERVICE CONFIGURATION
@stormsson
stormsson / wp_domain_replacement.sql
Last active August 29, 2015 14:14
Wordpress Sostituzione dominio
update wp_options set option_value = REPLACE(option_value,'www.old_site.com','www.new_site.com');
update wp_postmeta set meta_value = REPLACE(meta_value,'www.old_site.com','www.new_site.com');
update wp_posts set guid = REPLACE(guid,'www.old_site.com','www.new_site.com'), post_content = REPLACE(post_content,'www.old_site.com','www.new_site.com');
@stormsson
stormsson / devify
Last active August 29, 2015 14:06 — forked from mrosati84/devify
#!/bin/bash
# create Dev Machine structure
function createStructure {
# TODO
# 1- check existing folders
# 2- ask user for overwriting
if [ -d manifests ] ||
[ -d modules ] ||
[ -d xdebug ] ||
@stormsson
stormsson / gist:84bdc86fbe055a824993
Created June 17, 2014 15:52
JS - Google Universal Analyiics virtual pageview
ga('send','pageview', 'path_of_the_fake_page');
@stormsson
stormsson / gist:28559cf08e4dcca5c6ba
Last active May 19, 2020 12:55
PHP - Imagick resize/crop gif
$imagick = new \Imagine\Imagick\Imagine();
$image = $imagick->open($image_path);
$image = $image->getImagick()->coalesceImages();
foreach ($image as $frame)
{
$frame->cropImage($crop_w,$crop_h,0,0);
$frame->thumbnailImage($resize_w,$resize_h);