Skip to content

Instantly share code, notes, and snippets.

View burdiuz's full-sized avatar
💭
isotope muffin

Oleg Galaburda burdiuz

💭
isotope muffin
View GitHub Profile
@burdiuz
burdiuz / CSSValue.js
Last active October 24, 2016 08:17
Simple class that uses getComputedStyle() to convert any CSS value unit into PX or integers/numbers.
class CSSValue {
static toPx(value) {
CSSValue._element.style.fontSize = value;
return window.getComputedStyle(CSSValue._element).fontSize;
}
static toInt(value) {
return parseInt(CSSValue.toPx(value));
}
@burdiuz
burdiuz / Color.js
Last active December 5, 2016 18:56
Set of JavaScript classes were created for color manipulations. With these classes you can change color components independently.
'use strict';
/**
* Original HSL <> RGB, HSV <> RGB transformation algorithms can be found here:
* https://gist.github.com/mjackson/5311256
*/
const COLOR_PART = 1 / 0xff;
const HUE_PART = 1 / 6;
@burdiuz
burdiuz / Pixels.js
Last active December 5, 2016 18:55
Pixels helps working with ImageData color information that is originally stored as huge one dimensional array.
'use strict';
export default class Pixels {
/*
_image = null;
_data = null;
_width = null;
_height = null;
*/
constructor(imageData) {
@burdiuz
burdiuz / SteamFineDiscounts.js
Last active August 21, 2023 09:06
user-scripts for Steam Store
/* Filters items on Steam Store search page to display only fine discounted.
Steam Sale fine discounts
1. Open [Steam Search page](http://store.steampowered.com/search/?sort_by=Price_ASC&specials=1)
2. Check to be logged in, script will hide owned games
3. Open Browser console with Ctrl+Shift+I for Chrome(Console tab), Ctrl+Shift+K for Firefox, F12 for IE.
4. Paste code from [search-userscript.js](https://raw.githubusercontent.com/burdiuz/js-steam-fine-discounts/master/search-userscript.js) into console and press Enter
5. Wait for fine discounts to be found and displayed
*/
(function() {
var categories = '998,994,21,996,997'; // 998 - games
/**
* Created by Oleg Galaburda on 23.02.16.
*/
var os = require('os');
var fs = require('fs');
var path = require('path');
var through = require('through2');
var async = require('async');
var vfs = require('vinyl-fs');
var uglify = require('gulp-uglify');
@burdiuz
burdiuz / JQuery-custom-valhooks.js
Last active October 24, 2016 08:30
jQuery Custom .val() hook plugin adds possibility to specify .val() accessors and mutators for custom elements and selectors.
// Uses Node, AMD or browser globals to create a module.
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('jquery'));
@burdiuz
burdiuz / bootstrap-dropdown-select.js
Last active September 13, 2021 00:54
Adds some `<select>` element functionality to Bootstrap dropdown control -- you can use `.val()` method and listen to `change` event.
// Uses Node, AMD or browser globals to create a module.
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery', 'jquery-custom-valhooks', 'bootstrap'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('jquery'), require('jquery-custom-valhooks'), require('bootstrap'));
@burdiuz
burdiuz / server.js
Last active October 28, 2016 20:45
Simple HTTP server for static files using express
/**
node server
http://localhost:8081
*/
(function(express){
this.use(express.static('.'));
this.listen(8081, function(){
console.log('Server started...');
});
}).apply(require('express')(), [require('express')]);
@burdiuz
burdiuz / fb-isawthis.perm.tm.user.js
Created October 28, 2016 20:49
Userscript Chrome/Tampermonkey to hide scrolled out stories from Facebook feed.
// ==UserScript==
// @name FB I Saw This!
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Permanently hide story from FB news feed when its scrolled out.
// @author a_[w]
// @match https://www.facebook.com/
// @grant none
// ==/UserScript==
@burdiuz
burdiuz / ConvexText.js
Last active December 5, 2016 19:29
Create convex text from canvas
'use strict';
import Pixels from 'Pixels';
import {HSBA, RGBA} from 'Color';
const pixels = new Pixels();
const hsba = new HSBA();
const PI_2 = Math.PI * 0.5;