Skip to content

Instantly share code, notes, and snippets.

@DenVdmj
DenVdmj / background.js
Last active Jun 30, 2018
Enable brotli supporting for http requests. Chrome extension.
View background.js
chrome.webRequest.onBeforeSendHeaders.addListener(details => {
let headers = details.requestHeaders;
let header = headers.find(header => /accept-encoding/i.test(header.name));
if (header) {
header.value = header.value.split(/\s*,\s*/).concat('br').join(', ');
}
return { requestHeaders: headers }
}, {
urls: ['*://*/*']
@DenVdmj
DenVdmj / ff.manifest.json
Last active Jun 30, 2018
Добавляет на каждую страницу Хабра кнопку перехода на http://sohabr.so и http://itnan.ru
View ff.manifest.json
{
"manifest_version": 2,
"name": "sohabr.net button",
"description": "sohabr.net button for habr.com",
"version": "0.0.1.0",
"icons": {
"64": "sohabr.png"
},
"applications": {
"gecko": {
View way to draw bezier curves.md

I'm investigating the way to draw bezier curves / nurbs etc. with shaders, here is a list a links and information I found that can improve render times with OF. Any way I must admit I'm new to openGL & shaders so maybe someone can take this to implement maybe an add-on or maybe to added to the core.

Resolution Independent Curve Rendering using Programmable Graphics Hardware https://www.microsoft.com/en-us/research/wp-content/uploads/2005/01/p1000-loop.pdf

Resolution independent GPU accelerated Curve & Font rendering GPU based Resolution Independent Font & Curve Rendering – initial Release http://jausoft.com/blog/2011/04/01/resolution-independent-gpu-accelerated-curve-font-rendering/ http://ramisantina.com/blog/?p=73 http://vimeo.com/21810192

@DenVdmj
DenVdmj / index.html
Created Jun 13, 2018
RegExp Optimization (es6)
View index.html
<html>
<head>
<title>RegExp optimization</title>
<meta charset="utf-8" />
</head>
<body>
<h1>RegExp Optimization</h1>
<button create-regexp>Create RegExp from words list</button>
<textarea input>
a, abbr, acronym, address, applet, area,
View play-flac.js
console.info('flac player init start');
const copy = (el, props) => {
for (let [key, val] of Object.entries(props)) {
el[key] = val;
}
};
const audioElements = [];
@DenVdmj
DenVdmj / background.js
Created May 4, 2018 — forked from Rob--W/background.js
Implementation example of writable response bodies for Chromium extensions (API draft).
View background.js
/**
* Implementation example of writable response bodies.
* Based on the draft of the Streams API (19 March 2014)
* https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm
* Design document for response body reading/writing:
* https://docs.google.com/document/d/1iE6M-YSmPtMOsec7pR-ILWveQie8JQQXTm15JKEcUT8
*/
/* globals chrome, ByteStream, URL, XMLHttpRequest */
'use strict';
@DenVdmj
DenVdmj / jsfiddle.js
Last active Jun 21, 2018
Toggle left sidebar button for jsfiddle.net
View jsfiddle.js
const prefix = 'VdMj';
const class_hidden = `${prefix}-hidden-sidebar`;
const class_button = `${prefix}-menu-button`;
const styles = [
`body.${class_hidden} #sidebar { display: none !important }`,
`body.${class_hidden} #content { margin-left: 0 !important }`,
`#actions > nav > div:first-child > a.${class_button} {
font-size: 1.6em;
font-family: segoe ui symbol, apple color emoji, segoe ui emoji, notocoloremoji, android emoji, emojisymbols, emojione mozilla;
@DenVdmj
DenVdmj / pocket-guide-to-writing-svg.cover.ru.svg
Last active Jun 27, 2018
Русский вариант обложки книги Джони Трайтел «Карманное руководство по написанию SVG»
View pocket-guide-to-writing-svg.cover.ru.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.