Skip to content

Instantly share code, notes, and snippets.

View biapar's full-sized avatar
🙂

Biagio Paruolo biapar

🙂
View GitHub Profile
// 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');
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
@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();
@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 / 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 / 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 / package.json
Created November 19, 2015 13:23 — forked from Benjaminsson/package.json
My boilerplate packe.json for an Umbraco site
{
"name": "package",
"version": "1.0.0",
"private": true,
"devDependencies": {
"gulp": "~3.8.11",
"gulp-load-plugins": "~0.10.0",
"browser-sync": "~2.7.2",
"wiredep": "~2.2.2",
@biapar
biapar / gist:18a9c4d77702743dbca4
Created December 17, 2015 14:16 — forked from grandmanitou/gist:8863248
Place multiple markers with infowindow on Google Maps API v3, use external links to trigger click and center map on desired location.
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?language=fra&amp;sensor=false"></script>
<script type="text/javascript">
var map;
var Markers = {};
var infowindow;
var locations = [
[
'Samsung Store Madeleine',
'<strong>Samsung Store Madeleine</strong><p>5 Boulevard Malesherbes, 75008 Paris<br>10h – 20h</p>',
48.8701925,
@biapar
biapar / hacked wordpress scan
Created January 11, 2016 12:32 — forked from splacento-incomm/hacked wordpress scan
Hacked wordpress can /usr/bin/host
/usr/bin/host has been preloaded;
grep -ri --include=*.php "/usr/bin/host" ./
check all cronjobs:
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
check running processes:
ps -aux