Skip to content

Instantly share code, notes, and snippets.

View biapar's full-sized avatar
🙂

Biagio Paruolo biapar

🙂
View GitHub Profile
@biapar
biapar / gulpfile.js
Created November 19, 2015 13:23 — forked from Benjaminsson/gulpfile.js
Boilerplate gulpfile for Umbraco projects
'use strict';
// Load plugins
var gulp = require('gulp'),
$ = require('gulp-load-plugins')(),
browserSync = require('browser-sync'),
reload = browserSync.reload;
// Sass
gulp.task('sass:dev', function () {
@biapar
biapar / CheckoutConfirmationForm.cshtml
Created October 15, 2015 10:58
Paypal Install on Merchello 1.10.1
// Add Into Views/Partials of Merchello.Bazaar plugin under Umbraco
// Into Umbraco Web.Config:
// <add key="Bazaar:ResolvePaymentForms" value="False" />
<!-- PayPal Payment Method -->
<div id="PayPalPayment" class="payment-method-form well">
@using (Html.BeginUmbracoForm<SalePreparationOperationsController>("ConfirmPayPalSale", null, new { @id = "ConfirmPayPalSale" }))
{
@biapar
biapar / XMLSitemap.cshtml
Created October 10, 2015 15:26 — forked from alindgren/XMLSitemap.cshtml
XML sitemap for Umbraco 7 (based on Cultiv Search Engine Sitemap package). See http://www.alexlindgren.com/archive/dynamically-generated-xml-sitemaps-with-umbraco-7/
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using System.Linq;
@{
Layout = null;
Response.ContentType = "text/xml";
}<?xml version='1.0' encoding='UTF-8' ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemalocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
@ListChildNodes(Umbraco.TypedContent(UmbracoContext.Current.PageId).AncestorOrSelf(1))
@biapar
biapar / InitArcheType
Last active October 18, 2015 11:03
How to read and write to Umbraco Archetype
var archetypeValueAsString = member.GetValue<string>("figli");
var member = Services.MemberService.GetById(user.Id);
if (archetypeValueAsString == null)
{
//var archetype2 = JsonConvert.DeserializeObject<ArchetypeModel>(archetypeValueAsString);
ArchetypeModel a = new ArchetypeModel();
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
// This is our destination canvas.
var canvas = $('#doughnut')[0];
var ctx = canvas.getContext('2d')
// This is the canvas we're going to render chart.js to.
var placeholder = document.createElement('canvas');
placeholder.width = $(canvas).width();
placeholder.height = placeholder.width;
var placeholderctx = placeholder.getContext('2d');