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
// ==UserScript== | |
// @name youtube frame | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.youtube.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com | |
// @grant none | |
// ==/UserScript== |
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 uploadFile = (fileName, fileType = '', selector) => { | |
cy.get(selector).then(subject => { | |
cy.fixture(fileName, 'base64') | |
.then(Cypress.Blob.base64StringToBlob) | |
.then(blob => { | |
const el = subject[0] | |
const testFile = new File([blob], fileName, { type: fileType }) | |
const dataTransfer = new DataTransfer() | |
dataTransfer.items.add(testFile) | |
el.files = dataTransfer.files |
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
let styleEl; | |
let keyframeID = 0; | |
const insertionObserver = function(selector, callback) { | |
if (!styleEl) { | |
styleEl = document.createElement('style'); | |
document.head.appendChild(styleEl); | |
} | |
const curKeyframeName = `insertionObserver${keyframeID++}`; | |
const keyframesRule = `@keyframes ${curKeyframeName} { from { opacity: 0.99; } to { opacity: 1; } }`; | |
const styleRule = `${selector} { animation-duration: 0.001s; animation-name: ${curKeyframeName}; }`; |
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
// ==UserScript== | |
// @name stash avatar initials | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://stash.bbpd.io/* | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name remove reddit ads | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.reddit.com/ | |
// @grant none | |
// ==/UserScript== |
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
(function openOdestCommitPage([_, repo, branch='master']) { | |
return fetch('https://api.github.com/repos/' + repo + '/commits?sha=' + branch) | |
// the link header has additional urls for paging | |
// parse the original JSON for the case where no other pages exist | |
.then(res => Promise.all([res.headers.get('link'), res.json()])) | |
// get last page of commits | |
.then(([link, commits]) => { | |
if (!link) { | |
return; | |
} |
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
set -g default-terminal "screen-256color" | |
# remap prefix to Control + a | |
set -g prefix C-a | |
# bind 'C-a C-a' to type 'C-a' | |
bind C-a send-prefix | |
unbind C-b | |
#Force a reload of the config file |
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
function type(obj) { | |
var toString = Object.prototype.toString; | |
var map = { | |
'[object Boolean]' : 'boolean', | |
'[object Number]' : 'number', | |
'[object String]' : 'string', | |
'[object Function]' : 'function', | |
'[object Array]' : 'array', | |
'[object Date]' : 'date', | |
'[object RegExp]' : 'regExp', |
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
function scopeWalker(scope, op) { | |
var _walker = (scope) => { | |
op(scope); | |
var currentChildScope = scope.$$childHead; | |
while(currentChildScope) { | |
_walker(currentChildScope); | |
currentChildScope = currentChildScope.$$nextSibling; | |
} | |
} | |
_walker(scope); |
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
angular.element(document) | |
.injector() | |
.invoke(['$rootScope', function($rootScope) { | |
var a = performance.now(); | |
$rootScope.$apply(); | |
return performance.now()-a; | |
}]) | |
angular.element(document) |
NewerOlder