Skip to content

Instantly share code, notes, and snippets.

private async createListItem() {
try {
const spOpts: ISPHttpClientOptions = {
body: `{ Title: 'My New Item' }`
};
const response = await this.context.spHttpClient.post(`https://tenant.sharepoint.com/sites/anothersitecollection/_api/web/lists/GetByTitle('test')/items`, SPHttpClient.configurations.v1, spOpts);
if (!response.ok) {
const responseText = await response.text();
// ==UserScript==
// @name Spotify ad skipper
// @version 1.0
// @namespace http://tampermonkey.net/
// @description Detects and skips ads on spotify
// @match https://*.spotify.com/*
// @grant none
// @run-at document-start
// @downloadURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw
// @updateURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw
@johnnycardy
johnnycardy / ExecuteQueryAsync
Last active August 29, 2019 08:18
ExecuteQueryAsync for Microsoft SharePoint CSOM 15/16 (On Premise)
private static async Task CSOM15ExecuteAsync(ClientRuntimeContext clientContext)
{
try
{
//ScriptTypeMap.EnsureInited();
Assembly csomRuntime = Assembly.GetAssembly(typeof(ClientRuntimeContext));
Type scriptTypeMap = csomRuntime.GetType("Microsoft.SharePoint.Client.ScriptTypeMap");
InvokePrivateStaticMethod(scriptTypeMap, "EnsureInited");
//ClientRequest pendingRequest = PendingRequest;
@timwco
timwco / delete.md
Last active October 13, 2025 14:32
LinkedIn: Delete Messages (June 2022)

What

LinkedIn is a valuable resource, but sometimes it sucks. One of those times is when you want to delete messages. You have to select each message one by one. It takes about 4 "clicks" to successfully delete a message.

This script should help. Since LI requires you to perform multiple steps, I decided to automate it for you. Once you initiate the script, it will run every second. If a message has the ability to be deleted, it will be. If not, it will be archived. Some "InMail" messages cannot be deleted on the web app. This script should work as long as LI doesn't change their page layout or element names, which happens often.

Last tested & verified working on: June, 10, 2022

Special Thanks to @noncent for the updated script.

@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active April 15, 2026 06:01
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@anoopt
anoopt / UpdateQuickLinks.js
Created March 16, 2021 12:39
Update links in the SharePoint modern "Quick Links" webpart using PnP JS and SP editor extension
@lionbytes
lionbytes / gist:2e8ad01d0ec318354aa5e95b746c7e54
Last active February 15, 2023 13:04
Twitter-API-Friendly Like Remover
For those who want to remove their Twitter likes in bulk, but are being blocked by Twitter's API,
I give you a slower version that is more API-friendly; it removes each like one at a time.
Open your Twitter likes page on a separate browser window, then run the following code in the console:
```javascript
setInterval(() => {
document.querySelectorAll('div[data-testid="unlike"]')[0].click();
window.scrollTo(0, window.pageYOffset+300);
}, 1000);
```
@origamiofficial
origamiofficial / Recaptcha Solver (Automatically solves Recaptcha in browser).user.js
Created March 25, 2022 04:42
Recaptcha Solver in Browser | Automatically solves Recaptcha in browser by engageub | Note: This script is solely intended for the use of educational purposes only and not to abuse any website. This script uses audio in order to solve the captcha. Use it wisely and do not abuse any website. Click "Raw" to install it on Tampermonkey
// ==UserScript==
// @name Recaptcha Solver (Automatically solves Recaptcha in browser)
// @namespace Recaptcha Solver
// @version 2.1
// @description Recaptcha Solver in Browser | Automatically solves Recaptcha in browser
// @author engageub
// @match *://*/recaptcha/*
// @connect engageub.pythonanywhere.com
// @connect engageub1.pythonanywhere.com
// @grant GM_xmlhttpRequest
@{
'e4654015-5daf-4a48-9b37-4f309dddd88b' = 'Advanced Communications'
'd2dea78b-507c-4e56-b400-39447f4738f8' = 'AI Builder Capacity add-on'
'8f0c5670-4e56-4892-b06d-91c085d7004f' = 'App Connect IW'
'9706eed9-966f-4f1b-94f6-bb2b4af99a5b' = 'App governance add-on to Microsoft Defender for Cloud Apps'
'0c266dff-15dd-4b49-8397-2bb16070ed52' = 'Microsoft 365 Audio Conferencing'
'c2cda955-3359-44e5-989f-852ca0cfa02f' = 'Microsoft 365 Audio Conferencing for faculty'
'2b9c8e7c-319c-43a2-a2a0-48c5c6161de7' = 'Microsoft Entra Basic'
'078d2b04-f1bd-4111-bbd4-b4b1b354cef4' = 'Microsoft Entra ID P1'
'30fc3c36-5a95-4956-ba57-c09c2a600bb9' = 'Microsoft Entra ID P1 for faculty'