Skip to content

Instantly share code, notes, and snippets.

@Eccenux
Eccenux / .Ext.ux.grid.RestoreFilters.js
Last active August 22, 2016 11:15
ExtJS Restore filters grid plugin
/* global Ext */
/**
* Restore filters grid plugin.
*
* To use this plugin just add to your grid
* 1. `'Ext.ux.grid.RestoreFilters'` in `requires` property
* 2. `ptype: 'gridrestorefilters'` in `plugins` property
* 3. and `restoreableFilters` array as a setting for the plugin (see below)
*
@Eccenux
Eccenux / iitc-plugin-keyhunt.user.js
Last active August 2, 2019 10:30
This is a uniques plugin fork which assists you in hunting keys from certain area. Effectively allows to tick a portal for which you have a key. Switch to "keyhunt" highlighter (included in this plugin) to show in red which keys you are still missing (in orange will be portals for which you haven't entered data yet). Use 'sync' plugin to share d…
// ==UserScript==
// @id iitc-plugin-keyhunt-keys@3ch01c
// @name IITC plugin: keyhunt-keys
// @category Misc
// @version 0.0.3.20160405.143600
// @namespace https://github.com/3ch01c/ingress-intel-total-conversion
// @description This is a plugin which assists you in hunting keys from certain area. Effectively allows to tick a portal for which you have a key. Switch to "keyhunt" highlighter (included in this plugin) to show in red which keys you are still missing (the portal for which you haven't entered data yet will be orange, other will be green). Use 'sync' plugin to share data between multiple browsers or desktop/mobile. Use keyhunt plugin with 'portals-list' plugin to quickly tick many portals on a list.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
@Eccenux
Eccenux / NuxPadder.js
Last active March 31, 2016 17:20
Pad left class :-]
/**
* Pad class.
*
* @author Maciej "Nux" Jaros
* @license CC-BY
*
* Note! The class becomes faster with new itterations.
*/
NuxPadder = function (character)
{
@Eccenux
Eccenux / DataCache.js
Created April 1, 2016 13:28
Class providing caching for data objects (e.g. translations).
/**
* Class providing caching for data objects.
*
* It's assumed that the data comes from some remote service (otherwise there is no point in caching).
*
* @param {String} dataKey Globally(!) unique key to store data.
* @param {Storage} storageService Storage service that should have two functions:
* storageService.set(key, value) -- set data
* storageService.get(key) -- get data
* Will attempt fallback to `$.jStorage` if not secified.
@Eccenux
Eccenux / localStorageSize.js
Created April 1, 2016 14:06
localStorage size check (obviously it only works for current domain)
var keys = Object.keys(localStorage);
var total = 0;
for (var i in keys) {
var key = keys[i];
var size = localStorage[key].length;
console.log(key, ' size ', getReadableFileSizeString(size));
total += size;
}
console.log('\n-------\ntotal size ', getReadableFileSizeString(total));
@Eccenux
Eccenux / logPreservation.js
Last active October 11, 2016 18:02
Utility for console logs preservation.
/**
* Utility for console logs preservation.
*
* @example Enable logs preservation for next page load:
* logPreservation.enable();
*
* @example Dump, but keep log entries for another dump:
* logPreservation.dump(true);
*
* @author Maciej Nux Jaros
@Eccenux
Eccenux / snippet.html
Created October 19, 2016 20:41
With/without JS styling
<!-- with and without JS visibility and display -->
<style type="text/css">
.withJSvisible {visibility: hidden}
.withJSdisplay {display:none}
</style>
<script type="text/javascript">
document.write(String.fromCharCode(60),'style type="text/css"',String.fromCharCode(62),
' .withJSvisible {visibility:visible !important} ',
' .withoutJSvisible {visibility:hidden !important} ',
@Eccenux
Eccenux / InsertDate.gs
Created November 21, 2016 11:20
InsertDate Spreadsheet extenstion
/**
* The onOpen function runs automatically when the Google Docs document is
* opened.
*
* More on `onOpen` and other trigger functions: https://developers.google.com/apps-script/guides/triggers/
* More on `SpreadsheetApp` class: https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app
*/
function onOpen() {
// Add a menu with some items, some separators, and a sub-menu.
SpreadsheetApp.getUi().createMenu('Utilities')
@Eccenux
Eccenux / ReArray.js
Last active November 21, 2024 12:44
ViewFilter: Adds a simple filter input for any views (widgets/components).
/**
* Helper class for testing match of an array of strings.
*
* @param {Array} strings Array of strings to be prepared and used in search.
* @param {String} regExpFlags Flags passed to RegExp (g/i/m).
*/
class ReArray {
constructor(strings, regExpFlags, exactMatch) {
this._reArray = [];
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.editarea {
border: 1px solid black;
background: white;