Skip to content

Instantly share code, notes, and snippets.

@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);
```
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active May 3, 2024 11:24
[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()
 }
@timwco
timwco / delete.md
Last active July 20, 2023 15:59
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.

@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;
// ==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
@andyhuey
andyhuey / deleteAllFromList.cs
Created December 21, 2016 20:39
CSOM code to delete all items from a SharePoint list
private void deleteAllFromList(ClientContext cc, List myList)
{
int queryLimit = 4000;
int batchLimit = 100;
bool moreItems = true;
string viewXml = string.Format(@"
<View>
<Query><Where></Where></Query>
<ViewFields>
@vgrem
vgrem / Activate-GoogleAnalytics.ps1
Created November 2, 2016 10:24
Register Google Analytics in SharePoint 2010/2013 site
param(
[string]$Url,
[string]$UserName,
[string]$Password,
[string]$Domain,
[string]$Code
)
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
@xvitaly
xvitaly / remove_crw.cmd
Last active March 16, 2024 16:12
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
@glapointe
glapointe / Load-CSOMProperties.ps1
Created March 31, 2015 20:28
Utility PowerShell function that facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object.
<#
.Synopsis
Facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object.
.DESCRIPTION
Replicates what you would do with a lambda expression in C#.
For example, "ctx.Load(list, l => list.Title, l => list.Id)" becomes
"Load-CSOMProperties -object $list -propertyNames @('Title', 'Id')".
.EXAMPLE
Load-CSOMProperties -parentObject $web -collectionObject $web.Fields -propertyNames @("InternalName", "Id") -parentPropertyName "Fields" -executeQuery
$web.Fields | select InternalName, Id
@purtuga
purtuga / ie.aspx
Last active January 11, 2019 13:36
SharePoint file that forces IE into EDGE mode and load a given aspx page in an iframe. See http://wp.me/p2kCXW-95
<!DOCTYPE html>
<html>
<head>
<!--
Set the IE rendering engine to EDGE and loads a given aspx file in an iframe,
thus forcing it to be rendered using the browser's latest rendering engine.
Usage: ie.aspx?file.aspx
The default page to be loaded, when this file is accessed, can be set below (url variable).