Skip to content

Instantly share code, notes, and snippets.

@davideicardi
davideicardi / msdeploy-azure.ps1
Last active February 24, 2017 17:35
Deploy a website to azure using web deploy cmd
# $deployCredentials = d3-CreateCredential
# d3-AzureMsDeployWebSite -deployCredentials $deployCredentials -siteName "webplu-test-distribution" -packageDeployCmd "./Deltatre.Forge.DistributionApi.deploy.cmd"
Function d3-AzureMsDeployWebSite
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]$deployCredentials,
[Parameter(Mandatory = $true)]
@davideicardi
davideicardi / diThreeJsViewer.js
Created April 19, 2015 09:18
Angular Js directive that display a three.js model
// usage:
// <di-three-js-viewer three-js-object="device3DModel"></di-three-js-viewer>
app.directive('diThreeJsViewer', [function() {
function createThreeJsCanvas(parentElement, object) {
var width = 400;
var height = 400;
var scene = new THREE.Scene();
@davideicardi
davideicardi / ThrottledWorker.cs
Last active June 5, 2017 14:33
C# throttled worker with duplicate detection
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace AsyncThrottledSetSample
{
class Program
{
@davideicardi
davideicardi / checkurl.ps1
Last active July 18, 2017 16:50
Check url with powershell
invoke-webrequest http://www.lastampa.it/ -DisableKeepAlive -UseBasicParsing | Select -ExpandProperty "StatusCode"
@davideicardi
davideicardi / oembed-webtask.js
Last active September 27, 2017 22:24
oEmbed creator webtask
'use latest';
import express from 'express';
import { fromExpress } from 'webtask-tools';
import bodyParser from 'body-parser';
import request from 'request';
import cheerio from 'cheerio';
import escapeHtml from 'escape-html';
const app = express();
@davideicardi
davideicardi / SmartCollection.js
Last active October 31, 2017 10:22
mongodb library for node.js (Q promise support, schema validation)
var Q = require("q");
//var mongoClient = require("mongodb").MongoClient;
//var ObjectID = require("mongodb").ObjectID;
//var schema = require('validate');
function SmartCollection (mongoDb, collectionName, schema, indexes) {
this._mongoDb = mongoDb;
this._collectionName = collectionName;
this._collection = mongoDb.collection(collectionName);
@davideicardi
davideicardi / server.js
Created November 29, 2017 18:12
Stupid node.js utility that capture and print any http request
const express = require("express");
const app = express();
app.all("/*", (req, res) => {
console.log(`${req.method} ${req.originalUrl}`);
for (const h in req.headers) {
console.log(`\t ${h}:${req.headers[h]}`);
}
@davideicardi
davideicardi / README.md
Last active March 7, 2018 16:37
Development mongodb cluster tutorial
@davideicardi
davideicardi / schema.xml
Last active June 11, 2018 17:09
Basic SolR 4 (Cloudera 5) configurations
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@davideicardi
davideicardi / README.md
Last active June 26, 2018 13:54
Alpakka HBase connector, write Akka messages to HBase