Skip to content

Instantly share code, notes, and snippets.

View AleLudovici's full-sized avatar

Alessandro Ludovici AleLudovici

  • Ocado
  • Barcelona
View GitHub Profile
@AleLudovici
AleLudovici / StringExtensionHTML.swift
Created February 10, 2017 15:09 — forked from mwaterfall/StringExtensionHTML.swift
Decoding HTML Entities in Swift
// Very slightly adapted from http://stackoverflow.com/a/30141700/106244
// 99.99% Credit to Martin R!
// Mapping from XML/HTML character entity reference to character
// From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
private let characterEntities : [String: Character] = [
// XML predefined entities:
""" : "\"",
"&" : "&",
@AleLudovici
AleLudovici / StringExtensionHTML.swift
Created February 10, 2017 15:09 — forked from mwaterfall/StringExtensionHTML.swift
Decoding HTML Entities in Swift
// Very slightly adapted from http://stackoverflow.com/a/30141700/106244
// 99.99% Credit to Martin R!
// Mapping from XML/HTML character entity reference to character
// From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
private let characterEntities : [String: Character] = [
// XML predefined entities:
""" : "\"",
"&" : "&",
@AleLudovici
AleLudovici / .jscsrc
Created January 19, 2015 10:16
Style guide for scribe-noting-plugin
{
"disallowKeywordsOnNewLine": ["else", "else if"],
"disallowNewlineBeforeBlockStatements": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpacesInCallExpression": true,
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideParentheses": true,