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
; 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 |
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
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 |
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
$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 |
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
/** | |
* 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) => { |
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 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"); |
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
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')) |
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
// 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 }, |
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
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' | |
} |
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
#!/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 |