Skip to content

Instantly share code, notes, and snippets.

View warpech's full-sized avatar
🤹‍♂️
Code sweet code

Marcin Warpechowski warpech

🤹‍♂️
Code sweet code
View GitHub Profile
@warpech
warpech / web_components.md
Last active October 4, 2015 15:26
Blog Post 1 - Web Components

Web Components

Set of new technologies

Web Components is an umbrella term for the set of upcoming standards for web development (see the W3C Web Components page). Each on its own, they are a useful contribution to the current toolset of a web developer. But together they form a completely new paradigm of how web applications are created.

Web Components consist of 4 standards proposals:

@warpech
warpech / jQuery.md
Last active October 4, 2015 15:26
Blog Post 3 - jQuery

Web Components from the perspective of a jQuery developer

This article is a homage to jQuery - a library that once was a great boost for the productiveness of thousands of web developers around the world. In the upcoming times, the benefit of using it will drop as web developers start to switch to the web standards, including Web Components.

Status quo

As of early 2014, current state of interactive web development heavily relies on established web standards - HTML, CSS and JavaScript, all of which have been subject to consistent iterative improvement during the last few years, with the support of all major web browser vendors.

As a report shows, 57.8% of all websites use JavaScript, of which stunning 93.2% use the jQuery library to enhance the development (source). There is a long tail of other libraries and micro frameworks that are being used instead, or in compliment to jQuery, but none of them has gotten close to

@warpech
warpech / jquery.handsontable.js
Created June 15, 2012 10:34
Fix for Korean characters?
/**
* Handsontable is a simple jQuery plugin for editable tables with basic copy-paste compatibility with Excel and Google Docs
*
* Copyright 2012, Marcin Warpechowski
* Licensed under the MIT license.
* http://warpech.github.com/jquery-handsontable/
*/
/*jslint white: true, browser: true, plusplus: true, indent: 4, maxerr: 50 */
(function ($) {
"use strict";
@warpech
warpech / nodeapp.js
Created February 20, 2015 12:57
Man in the middle
var express = require('express')
var bodyParser = require('body-parser');
var chalk = require('chalk');
var app = express()
app.use(bodyParser.text());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, spy-type");
@warpech
warpech / gist:5973876
Last active December 19, 2015 15:08
Excel copy paste tests
//1. Plain simple text (total 2 rows, 2 columns)
A0 B0
A1 B1
//2. Fully quoted text in first cell (total 2 rows, 2 columns)
"This is a fully quoted text in the A0 column" B0
A1 B1
//3. Partially quoted text in first cell (total 2 rows, 2 columns)
This is a "partially" quoted text in the A0 column B0
@warpech
warpech / no-threads.js
Last active December 21, 2015 01:38
current view model
//Master.json
//-----------
{
LoggedInUser: "",
ApplicationPage: {
}
}
//PMail.json (ApplicationPage)
//Master.json
//-----------
{
LoggedInUser: "",
ApplicationPage: {
}
}
//PMail.json (ApplicationPage)
@warpech
warpech / gist:6279679
Last active December 21, 2015 08:39
Current and expected response
//Request
//http://81.236.246.27:8080/mailboxes/Inbox
//Accept:application/json-patch+json
//Current response
[{"op":"add","path":"/Mails","value":{"From":{"Address":""},"Subject":"Hi there","Uri":"/mails/123"}},
{"op":"add","path":"/Mails","value":{"From":{"Address":""},"Subject":"Buy diet pills","Uri":"/mails/124"}},
{"op":"add","path":"/Mails","value":{"From":{"Address":""},"Subject":"Business opportunity","Uri":"/mails/125"}},
{"op":"replace","path":"/Mails/0/Subject","value":"Hi there"},
Handsontable.PluginHooks.add('afterRenderer', function(TD, row, col, prop, value, cellProperties) {
if (value === null) {
TD.style.fontStyle = 'italic';
TD.appendChild(document.createTextNode('NULL'));
}
});
@warpech
warpech / json-patch-duplex.js
Last active December 28, 2015 09:49
JSON Patch duplex - ignore locally added properties
// json-patch-duplex.js 0.3.6 with enhancement to ignore locally added properties
// (c) 2013 Joachim Wester
// MIT license
var jsonpatch;
(function (jsonpatch) {
var objOps = {
add: function (obj, key) {
obj[key] = this.value;
return true;
},