This file contains hidden or 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
<h1>Useful bookmarklets</h1> | |
<ul> | |
<li><a href="javascript:(function() { const urls = ['http://localhost:3000', 'https://produktion.com']; const defaultURL = urls[0];const currentOrigin = window.location.origin;const currentIndex = urls.indexOf(currentOrigin);const nextURL = currentIndex === -1 ? defaultURL : urls[(currentIndex + 1) % urls.length];window.open(window.location.href.replace(currentOrigin, nextURL));})()">Open the current URL but in a different environments</a></li> | |
<li><a href="javascript:(function() { const selector=prompt('Selector','.');const all=document.querySelectorAll(selector);console.log(all),[...all].map((e=>e.classList.add('debug-outline')));var newScript=document.createElement('style'),content=document.createTextNode('.debug-outline { outline: 1px solid #f0f; }');newScript.appendChild(content);var bodyClass=document.getElementsByTagName('head')[0];bodyClass.insertBefore(newScript,bodyClass.childNodes[2]),window.speechSynthesis.speak(new SpeechSynthesisUtterance(`${all.length} found` |
This file contains hidden or 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 regex = /^https?:\/\/twitter\.com\/(?:#!\/)?(\w+)\/status(?:es)?\/(\d+)(?:\/.*)?$/ | |
module.exports = { | |
defaultBrowser: "Google Chrome", | |
rewrite: [ | |
{ | |
match: ({urlString}) => { | |
const matches = urlString.match(regex); | |
finicky.log(JSON.stringify(matches, null, 2)) | |
return matches && matches[2]; |
This file contains hidden or 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
console.log('testing 123', document.currentScript); |
This file contains hidden or 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
// Rewrite all Bing links to DuckDuckGo instead | |
finicky.onUrl(function(url, opts) { | |
var url = url.replace( | |
/^https?:\/\/www\.bing\.com\/search/, | |
"https://duckduckgo.com" | |
); | |
return { | |
url: url | |
}; | |
}); |
This file contains hidden or 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
alert(); |
This file contains hidden or 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
FROM node:5.2.0 | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
ONBUILD COPY package.json /usr/src/app/ | |
ONBUILD COPY .npmrc /usr/src/app/ | |
ONBUILD RUN npm install | |
ONBUILD COPY . /usr/src/app |
This file contains hidden or 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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Remap Caps Lock to Hyper</name> | |
<appendix>OS X doesn't have a Hyper. This maps caps lock (actually F19) to Control + Shift + Option + Command.</appendix> | |
<identifier>caps_lock_to_hyper</identifier> | |
<autogen> | |
--KeyToKey-- |
This file contains hidden or 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
local utils = require 'utils' | |
hs.hotkey.bind(utils.hyper, "Left", utils.getScreen(function(win, frame, screen, screenFrame) | |
local margin = 10 | |
local myFrame = hs.fnutils.copy(frame) | |
myFrame.x = screenFrame.x + margin | |
myFrame.y = screenFrame.y + margin | |
myFrame.w = screenFrame.w/2 - margin*2 | |
myFrame.h = screenFrame.h - margin*2 | |
if utils.rectEquals(myFrame, frame) then |
This file contains hidden or 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
var keydown = function(k) { | |
var oEvent = document.createEvent('KeyboardEvent'); | |
// Chromium Hack | |
Object.defineProperty(oEvent, 'keyCode', { | |
get : function() { | |
return this.keyCodeVal; | |
} | |
}); |