Skip to content

Instantly share code, notes, and snippets.

View evenfrost's full-sized avatar

Aliaksei Kislou evenfrost

View GitHub Profile
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound',
waitOn: function () {
return [
Meteor.subscribe('users'),
Meteor.subscribe('companiesWithUsers')
];
}
@evenfrost
evenfrost / swapper.js
Last active January 11, 2017 16:51
Adds Alt+Shift shortcut for swapping languages in Google Translate.
/**
* Adds Alt+Shift shortcut for swapping languages in Google Translate.
* Best used with browser JS injectors such as
* https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija
*/
(function () {
var shiftKeyPressed = false,
altKeyPressed = false,
swap = document.querySelector('#gt-swap');
@evenfrost
evenfrost / harvest.js
Last active August 29, 2015 14:15
Adds a button to generate raw text data from daily entries on Harvest.
/**
* Adds a button to generate raw text data from daily entries on Harvest.
*/
(function () {
var button = document.createElement('button'),
nav = document.querySelector('#nav'),
dayLinks = document.querySelectorAll('.js-harvest-current-view .day-view-week-nav a.js-day'),
area;
@evenfrost
evenfrost / bandcamp.js
Created March 6, 2015 13:23
Clears all cokies from bandcamp site.
/**
* Clears all cokies from bandcamp site.
*/
(function () {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i].trim();
var eqPos = cookie.indexOf('=');
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
@evenfrost
evenfrost / trello.js
Created March 11, 2015 11:06
Sets emoji icons for tasks in Trello.
/**
* Sets emoji icons for tasks.
*/
var emojize = function () {
var tasks = Array.prototype.slice.call(document.querySelectorAll('.checklist-item:not(.checklist-item-state-complete)')),
i = 0,
len = tasks.length,
replacers = [
{
from: '/^low:\s/',
@evenfrost
evenfrost / golance-export.js
Last active November 6, 2015 18:04
Adds 'Export' button to work diary for easier reports creation
(() => {
'use strict';
let copy = () => {
let area = document.createElement('textarea');
let notificaitons = angular.element('*[ng-app]').injector().get("uiNotifications");
let titles = [];
let dateArray = new Date().toJSON().slice(0, 10).split('-');
let date = [dateArray[1], dateArray[2], dateArray[0]].join('/');
@evenfrost
evenfrost / meteor-collection-count.js
Created November 27, 2015 16:42
Return Meteor collections entities count for current page
(() => {
'use strict';
let collections = Meteor.connection._mongo_livedata_collections;
let names = Object.keys(collections);
let result = {};
for (let name of names) {
let collection = Meteor.connection._mongo_livedata_collections[name];
let keys = Object.keys(collection._docs._map);
@evenfrost
evenfrost / watch-link.js
Created December 21, 2015 20:15
Watcher for re-linking a local jspm package
// transform css to stylus
(\s{|}\n|}$|:|;)
{
"user": {
"debug": false,
"delay": 2,
"error_color": "E74C3C",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "load/save",
"linters": {
"eslint": {