This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Make a fkn break | |
// Menu: Make a fkn break | |
// Schedule: */15 * * * * | |
import "@johnlindquist/kit" | |
const duration = 15; // 15 seconds | |
const openFrame = async () => { | |
const startDate = Date.now(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const args = process.argv.slice(2); | |
const [filename] = args; | |
fs.readFile(filename, 'utf8', (err, data) => { | |
if (err) { | |
return console.log(err); | |
} | |
let r = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/** | |
* Hooks: | |
* https://www.kernel.org/pub/software/scm/git/docs/githooks.html#_prepare_commit_msg | |
* | |
* Colors: | |
* http://telepathy.freedesktop.org/doc/telepathy-glib/telepathy-glib-debug-ansi.html | |
* | |
* Message format: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Check if element fully visible. | |
* @param {jQuery} $el. | |
* @returns {boolean} Is visible or not. | |
*/ | |
isScrolledIntoView: function ($el) { | |
var $window = $(window); | |
var docViewTop = $window.scrollTop(); | |
var docViewBottom = docViewTop + $window.height(); | |
var elemTop = $el.offset().top; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get all items starting from the passed index that are located in the same top line. | |
* @param {jQuery} $items - List of elements. | |
* @param {Number} index - Index of the first element. | |
* @returns {Array|undefined} Found items. | |
*/ | |
getLineItems: function ($items, index) { | |
var $first = $items.eq(index); | |
var items = [$first]; | |
var $next, getNext, top; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Highlight passed array's strings in the passed string. | |
* @param {string} string - Original string. | |
* @param {Array<string>} matched - List of items to highlight. | |
* @returns {string} Highlighted string. | |
*/ | |
highlightStr: function (string, matched) { | |
string || (string = ''); | |
matched || (matched = []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Advanced timer with ability to pause/resume the callback. | |
* @param {function} callback - Callback to be executed after some delay. | |
* @param {number} delay - Delay. | |
* @returns {Object} Timer object with useful methods. | |
*/ | |
var timer = function (callback, delay) { | |
var isPaused = true; | |
var timer, start, clear, pause, resume; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Update the param value of the passed URI. | |
* In case parameter wasn't found we have to add it. | |
* @param {string} uri - URI. | |
* @param {string} key - Parameter name. | |
* @param {string} value - Parameter value. | |
* @returns {string} Updated URI. | |
*/ | |
var updateQueryStringParameter = function (uri, key, value) { | |
var re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global define */ | |
/*jshint expr:true */ | |
define([], function () { | |
'use strict'; | |
var hasLocalStorageSupport = (function () { | |
var str = 'storage-test-' + Math.random(); | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page { | |
size: auto; | |
margin: 0; | |
} | |
@media screen, print { | |
html, | |
body { | |
height: 100%; | |
} | |
body { |
NewerOlder