Skip to content

Instantly share code, notes, and snippets.

View heptal's full-sized avatar

Michael B heptal

View GitHub Profile
@rmorey
rmorey / gen.sh
Created August 17, 2021 19:58
List of Uniform Type Identifiers
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep uti: | cut -c 29- | sort | uniq > utis.txt
@jaoye
jaoye / AppStore_API.md
Last active October 15, 2024 11:10
[AppStore API] AppStore API #AppStore
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: file-code;
module.exports = async ({ url, headers = {} }) => {
const request = new Request(url);
request.method = methods.get;
request.headers = {
...headers
};
return await request.loadString();
@mdunham
mdunham / Create Delete All Messages Button
Last active May 1, 2022 03:08
How to delete all Facebook conversations easily. The script to be run inside Chrome's JavaScript console to delete all the messages and conversations from your Facebook inbox. Instruction: 1 - open your Facebook inbox folder https://www.facebook.com/messages/ 2 - open the Chrome JS console (ALT+CMD+J on Mac OS X) 3 - paste the script and press e…
Simple Method
An easier way to run the script is by simply creating a bookmark in your browser using the following:
Completely, safe.
Bookmark Name: Delete All FB Conversation
Bookmark Url : javascript:!function(){var e=function(o){var n=function(e){var o=function(){var o=document.querySelector("#webMessengerHeaderName").innerText,n=function(e){for(var n=0;n<e.length;n++){var t=e[n];if(-1!==t.innerHTML.indexOf("Delete Conversation"))return console.log("Deleting Messages From: "+o),t.click(),!0}return!1};if("No Selection"===o)return void l();if(!0===n(document.querySelectorAll('a[role="menuitem"]')))setTimeout(t,500);else{var r=document.querySelector('button[data-tooltip-content="Actions"]');if(!r)return void console.log("Unable to locate the delete button");r.click(),setTimeout(e,2e3)}},n=function(){var e=document.querySelector("div.uiScrollableAreaWrap.scrollable");return"undefined"==typeof e||!1===e.hasOwnProperty("scrollHeight")?(console.log("Unable to locate the messages scroll region"),!1):void(e.scro
@kizzx2
kizzx2 / hammerspoon-move-resize.lua
Last active December 19, 2022 06:47
Hammerspoon script to move/resize window under cursor
-- Inspired by Linux alt-drag or Better Touch Tools move/resize functionality
function get_window_under_mouse()
-- Invoke `hs.application` because `hs.window.orderedWindows()` doesn't do it
-- and breaks itself
local _ = hs.application
local my_pos = hs.geometry.new(hs.mouse.getAbsolutePosition())
local my_screen = hs.mouse.getCurrentScreen()
@RobTrew
RobTrew / JXA_PersistentProperties.js
Last active January 30, 2024 09:07
Persistent 'properties' for OS X JavaScript for Applications (JXA)
(function () {
'use strict';
// OSX JavaScript for Applications lacks the persistent 'properties'
// of AppleScript (in which global variables and properties persist between script runs)
// but we can, of course, serialise to JSON or plist at the end of a script
// parsing it at the start of the next run.
// Here is one approach to persistence between script runs
// using JSON.stringify() and JSON.parse()
@codenameyau
codenameyau / console-tricks.js
Last active April 6, 2022 13:07
Javascript Snippets
/************************************************************************
* CLIENT ONE-LINERS
*************************************************************************/
// Set top level domain cookie.
document.cookie = "token=12345; Max-Age=120; Secure; Domain=mozilla.org; Path=/;"
// Set a subdomain cookie.
document.cookie = "name=hello world; Max-Age=120; Secure; Domain=developer.mozilla.org; Path=/;"
@chroth7
chroth7 / reactD3rescources.md
Last active December 6, 2017 05:37
React/D3 Resources
@iMyon
iMyon / SearchByImage.user.js
Last active July 30, 2023 18:58
Search By Image 的一份fork
// ==UserScript==
// @name Search By Image
// @version 1.3.7
// @description Search By Image | 以图搜图
// @match <all_urls>
// @include *
// @author 864907600cc
// @mod Myon<[email protected]>
// @modDecs 添加长按右键弹出菜单
// @icon http://1.gravatar.com/avatar/147834caf9ccb0a66b2505c753747867