Skip to content

Instantly share code, notes, and snippets.

View zlatinz's full-sized avatar

Zlatin Zlatev zlatinz

View GitHub Profile
@peter-schmalfeldt
peter-schmalfeldt / convertStringToEmoji.js
Created October 26, 2023 04:07
Convert String to Emoji for SFCC XML Site Imports
/**
* Convert String to Emoji
* Most emoji's start with �
* If you have these in your SFCC Site Import XML File, you might get an import error.
*
* @usage convertStringToEmoji('��') => 🙂
* @param {String} str Raw URL Encoded String
*/
function convertStringToEmoji(str) {
// Regex matching either a surrogate or a character.
@egermano
egermano / ie-fix.js
Created November 26, 2013 22:05
ECMA Script fixes for IE
'use strict';
// Add ECMA262-5 method binding if not supported natively
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
@kmila
kmila / log4j_udl.xml
Last active September 28, 2016 12:29
Notepad++ (UDL2) to enable log4j syntax highlighting (solarized edition)
<NotepadPlus>
<UserLang name="log4j_dark" ext="log" udlVersion="2.1">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="yes" Keywords3="no" Keywords4="yes" Keywords5="no" Keywords6="yes" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments"></Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
@emilsoman
emilsoman / chain-of-responsibility.js
Created February 21, 2013 11:31
Chain of Responsibility design pattern in Javascript
//Chain of responsibility design pattern
//Use strategyPipeline.handleRequest(request)
//to send the request to be handled along the
//chain-of-responsibility
var strategyPipeline = {
handleRequest: function(request){
var strategy1 = new Strategy1();
var strategy2 = new Strategy2();
@mmdemirbas
mmdemirbas / LogFile.udl.xml
Created September 13, 2012 11:34
Custom log file syntax highlighting for Notepad++
<NotepadPlus>
<UserLang name="LogFile" ext="log">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">[(0])0</Keywords>
<Keywords name="Folder+"></Keywords>