Skip to content

Instantly share code, notes, and snippets.

View dvygolov's full-sized avatar
🤖
Replacing YOU with robots

Daniel Vygolov dvygolov

🤖
Replacing YOU with robots
View GitHub Profile
@valuex
valuex / SendTCCommand.ahk
Created August 3, 2023 11:55
Send Message to Total Commander
; Script name: SendTCCommand.ahk
; Sends a Total Commander command to a TC instance.
; Can be used from the scheduler for example.
; Specify the TC command as command line parameter for example:
; AutoHotkey.exe SendTCCommand.ahk cm_FtpNew
; Or if the script is compiled:
; SendTCCommand.exe cm_FtpNew
@dvygolov
dvygolov / fbvariables.js
Last active May 23, 2023 09:08
Ways to get various Facebook variablies useful in creating your own js-scripts
let accessToken = document.documentElement.innerHTML.match(new RegExp("EAABsbCS1[a-zA-Z0-9]*"))[0];
let accessToken2 = __accessToken; //The same as accessToken but easier to write
//built-in GraphAPI object usage
await require('AdsGraphAPI').get('15.0').adaccount('11111111111').get();
let lsd = require("LSD").token;
let dtsg = require("DTSGInitData").token;
let dtsg_ag = require("DTSGInitData").async_get_token; //The same as DTSG but for GET requests
let sessionId = require('AdsInterfacesSessionConfig').sessionID; //in some cases this one is required
@Braytiner
Braytiner / Windows Defender Exclusions VS 2022.ps1
Last active June 21, 2024 13:29
Adds Windows Defender exclusions for Visual Studio 2022
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\Downloads\HeidiSQL_11.3_64_Portable') > $null
$pathExclusions.Add($userPath + '\.dotnet') > $null
@BigSully
BigSully / async await in chrome extension
Last active March 19, 2024 20:59
async await in chrome extension
/**
* Usage:
* let cookies = await asyncfy(chrome.cookies.getAll)({ url })
* let tabs = await asyncfy(chrome.tabs.query)({active: true, currentWindow: true})
*
* @param fn A function that takes one or more parameters, and the last parameter is a callback which has one or more parameter. The simplest one is chrome.management.getSelf
* @returns {function(...[*]): Promise<any>} Return one value if the results array has only one element, else return the whole results array
*/
let asyncfy = fn => (...args) => {
return new Promise((resolve, reject) => {
@vielhuber
vielhuber / 01.js
Last active February 15, 2024 13:21
Google Translate API Hacking #knowhow #tools
function Bp(a, b) {
var c = b.split(".");
b = Number(c[0]) || 0;
for (var d = [], e = 0, f = 0; f < a.length; f++) {
var h = a.charCodeAt(f);
128 > h ? d[e++] = h : (2048 > h ? d[e++] = h >> 6 | 192 : (55296 == (h & 64512) && f + 1 < a.length && 56320 == (a.charCodeAt(f + 1) & 64512) ? (h = 65536 + ((h & 1023) << 10) + (a.charCodeAt(++f) & 1023), d[e++] = h >> 18 | 240, d[e++] = h >> 12 & 63 | 128) : d[e++] = h >> 12 | 224, d[e++] = h >> 6 & 63 | 128), d[e++] = h & 63 | 128)
}
a = b;
for (e = 0; e < d.length; e++) a += d[e], a = Ap(a, "+-a^+6");
a = Ap(a, "+-3^+b+-f");
@simon816
simon816 / chrome_bookmark_checksum.py
Created August 21, 2018 16:15
Calculate Chrome bookmarks checksum
from hashlib import md5
# See https://chromium.googlesource.com/chromium/src/+/master/components/bookmarks/browser/bookmark_codec.cc
def regen_checksum(roots):
digest = md5()
def digest_url(url):
digest.update(url['id'].encode('ascii'))
digest.update(url['name'].encode('UTF-16-LE'))
@DanDiplo
DanDiplo / JS-LINQ.js
Last active June 25, 2024 23:39
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@thefella
thefella / gist:3513221
Created August 29, 2012 14:16
Detect if browser request is a prefetch or prerender using PHP
if ( (isset($_SERVER["HTTP_X_PURPOSE"]) and (strtolower($_SERVER["HTTP_X_PURPOSE"]) == "preview")) or
(isset($_SERVER["HTTP_X_MOZ"]) and (strtolower($_SERVER["HTTP_X_MOZ"]) == "prefetch")) ) {
// Request is a prerender or prefetch
} else {
// Request is 'normal'
}
@gasman
gasman / pnginator.rb
Created April 30, 2012 18:08
pnginator: pack Javascript into a self-extracting PNG
#!/usr/bin/env ruby -w
# pnginator.rb: pack a .js file into a PNG image with an HTML payload;
# when saved with an .html extension and opened in a browser, the HTML extracts and executes
# the javascript.
# Usage: ruby pnginator.rb input.js output.png.html
# By Gasman <http://matt.west.co.tt/>
# from an original idea by Daeken: http://daeken.com/superpacking-js-demos