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 postId = window._preloads.post.id; | |
const url = window._preloads.base_url; | |
async function getComments() { | |
const response = await fetch(`${url}/api/v1/post/${postId}/comments?token=&all_comments=true&sort=most_recent_first`); | |
const result = await response.json(); | |
return result?.comments; | |
} | |
function getAllChildren(children, acc = []) { | |
for(const child of children) { |
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
* { | |
background:white !important; | |
color:black !important; | |
} | |
:link, :link * { | |
color:#0000EE !important; | |
} | |
:visited, :visited * { |
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 targetNode = document.querySelector('div[aria-label*="Timeline: Conversation"]') | |
const config = { attributes: false, childList: true, subtree: true } | |
function getElementByXpath(path) { | |
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
} | |
const callback = (mutationList, observer) => { | |
// We don't care what was mutated. The Xpath has to run at the document level anyway | |
const foundElement = getElementByXpath("//span[contains (text(), 'Ad')]//ancestor::article") |
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 getElementByXpath(path) { | |
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
} | |
getElementByXpath("//span[contains (text(), 'Ad')]//ancestor::article").remove() |
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
// bookmarklet_title: UnfuckSlack | |
// bookmarklet_about: idonotknowwhy | |
javascript:(function() { localStorage.setItem("localConfig_v2", localStorage.getItem("localConfig_v2").replace(/\"is_unified_user_client_enabled\":true/g, '\"is_unified_user_client_enabled\":false')); location.reload(); })(); |
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
// Simplified scope stack implementation | |
#include <new> | |
#include <cstdio> | |
#include <cassert> | |
typedef unsigned char u8; | |
class LinearAllocator { | |
public: |
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
struct TermCell | |
{ | |
uint GlyphIndex; // index into GlyphMapping buffer | |
uint Foreground; | |
uint Background; | |
}; | |
cbuffer ConstBuffer : register(b0) | |
{ | |
uint2 CellSize; |
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
Jobs | |
Jobs List | |
New Job -> New Job | |
Click on Job -> Job Details | |
Sort Column -> Jobs List | |
Filter Column -> Jobs List | |
Change Status Dropdown -> Jobs List | |
Job | |
Job Details | |
Edit -> Edit Job |
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
local alert = require("hs.alert") | |
local timer = require("hs.timer") | |
local eventtap = require("hs.eventtap") | |
local events = eventtap.event.types | |
local module = {} | |
-- timeout for ctrol key | |
module.timeFrame = .25 |
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
// takes arguments and produces an array of functions that accept context | |
function handle_args() { | |
var args = Array.prototype.slice.call(arguments); | |
return args.map(function(arg) { | |
if(arg instanceof Function) return arg; // Presumably already a contex-accepting function. | |
if(arg instanceof Array) return and.apply(this, arg); // make arrays behave as and. | |
// Presuming a string, build a function to check. | |
var my_regex = new RegExp(arg.toString(), 'i'); | |
return function(context) { | |
return context.search(my_regex) > -1; |