Skip to content

Instantly share code, notes, and snippets.

View obenjiro's full-sized avatar
🎯
Focusing

Alexey Okhrimenko obenjiro

🎯
Focusing
View GitHub Profile
@obenjiro
obenjiro / reactplusmalevich.md
Last active October 6, 2015 19:30
React + MALEVICH ( talk proposal )

#Conference Reactive 2015 ( https://reactive2015.com/ )

#Talk Title: React + MALEVICH

#Speaker: Oleksii Okhrymenko - Lead JavaScript developer

#Summary:

@obenjiro
obenjiro / xss.js
Last active October 9, 2015 10:46
Always escape quotes
<html>
<head>
<title>XSS with quotes only</title>
</head>
<body>
<span></span>
<script>
// this happens becouse we use raw value inside of attribute "title"
var titleText = 'asd" onmouseover="alert(1)"';
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<a onclick="test()" href="#">run</a>
<div class="main"></div>
@obenjiro
obenjiro / extjs-di.js
Last active November 15, 2015 22:12
ExtJs simplest possible DI ( Dependency Injection )
Ext.application({
name : 'Fiddle',
launch : function() {
var a = DependencyInjector.provide('A');
Ext.Msg.alert('Fiddle', a.getString());
}
});
Ext.define('DependencyContainer', {
@obenjiro
obenjiro / phonegap15-links.md
Last active February 26, 2016 14:09
Свой PhoneGap за 15 минут
@obenjiro
obenjiro / bitmask.js
Last active April 7, 2016 17:10
JS bitmask
console.clear();
var myEnum = {
left: 1 << 0,
right: 1 << 1,
top: 1 << 2,
bottom: 1 << 3
};
var myConfig = myEnum.left | myEnum.bottom | myEnum.right;
@obenjiro
obenjiro / zone.js
Last active April 23, 2016 22:46
Small implementation of Zones
console.clear();
var zone = {
init: function() {
zone.wrap(Window.prototype, 'setTimeout');
zone.wrap(Window.prototype, 'setInterval');
zone.wrap(Element.prototype, 'addEventListener', 1);
zone.wrap(Document.prototype, 'addEventListener', 1);
zone.wrap(Window.prototype, 'addEventListener', 1);
zone.wrapProtoOn(XMLHttpRequest);
@obenjiro
obenjiro / angular2isnotthatbad.md
Last active November 8, 2017 13:56
Angular 2 is not that bad - links
@obenjiro
obenjiro / parsersissparta.md
Last active September 13, 2020 18:03
Parsers - is Sparta!