Skip to content

Instantly share code, notes, and snippets.

View half-doughnut.js
// 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');
View topkeywords.js
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 / XMLSitemap.cshtml
Created Oct 10, 2015 — 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/
View XMLSitemap.cshtml
@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 Oct 18, 2015
How to read and write to Umbraco Archetype
View InitArcheType
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 / gulpfile.js
Created Nov 19, 2015 — forked from Benjaminsson/gulpfile.js
Boilerplate gulpfile for Umbraco projects
View gulpfile.js
'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 Nov 19, 2015 — forked from Benjaminsson/package.json
My boilerplate packe.json for an Umbraco site
View package.json
{
"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 Dec 17, 2015 — 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.
View gist:18a9c4d77702743dbca4
<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,
View Creating Shazam in Java
A backup of http://sites.google.com/site/redcodenl/creating-shazam-in-java-1 just in case
Why is this necessary? Read http://sites.google.com/site/redcodenl/patent-infringement
Please fork, tweet about, etc.
----
Creating Shazam in Java
A couple of days ago I encountered this article: How Shazam Works
This got me interested in how a program like Shazam works… And more importantly, how hard is it to program something similar in Java?
@biapar
biapar / CheckoutConfirmationForm.cshtml
Created Oct 15, 2015
Paypal Install on Merchello 1.10.1
View CheckoutConfirmationForm.cshtml
// 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" }))
{