Skip to content

Instantly share code, notes, and snippets.

@AlexP11223
AlexP11223 / mafia_de_crc.py
Last active August 15, 2021 09:48
Set the file path and launch the script using Python 3. It will update the checksum at the end of gameinputmodule.pf. https://www.pcgamingwiki.com/wiki/Mafia:_Definitive_Edition#Map_Extended_Mouse_Buttons
import os
import zlib
# for Linux (Steam/Proton):
# /home/<USER>/.steam/debian-installation/steamapps/compatdata/1030840/pfx/drive_c/users/steamuser/My Documents/My Games/Mafia Definitive Edition/Data/<USER_ID>/profiles/temporaryprofile/gameinputmodule.pf
file_path = 'C:/Users/<USER>/My Documents/My Games/Mafia Definitive Edition/Data/<USER_ID>/profiles/temporaryprofile/gameinputmodule.pf'
size = os.path.getsize(file_path)
var doOnce = function() {
var completed = false;
return function() {
if (!completed) {
console.log('hello');
completed = true;
}
};
}();
#Persistent
SetKeyDelay, 0
SetTimer, SkypeUpgrade, 250
return
SkypeUpgrade:
If WinExist("ahk_class TUpgradeForm")
{
ControlSend, , {Esc}, ahk_class TUpgradeForm
@AlexP11223
AlexP11223 / Drive.cs
Last active March 29, 2017 18:25
Simple example showing how to load disks information using WMI. C#, .NET
using System;
using System.Collections.Generic;
namespace WindowsFormsApplication19
{
class Drive
{
public string DeviceId { get; set; }
public string Model { get; set; }
using System;
using System.IO;
using System.Windows.Forms;
using Awesomium.Core;
using Awesomium.Windows.Forms;
namespace WindowsFormsApplication3
{
static class Program
{
/// <summary>
/// WebClient with Cookies support, UserAgent
/// </summary>
public class CookieAwareWebClient : WebClient
{
public CookieContainer CookieContainer { get; } = new CookieContainer();
public string UserAgent { get; set; } = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36";
protected override WebRequest GetWebRequest(Uri address)
using System;
using Awesomium.Core;
namespace WebViewHelpers
{
public static class WebViewExtensions
{
/// <summary>
/// Simulates mouse movement to the specified coordinates and click.
/// As I remember it requires coordinates relative to the currently displayed area, and also will not work if specified coordinates are out of that area.
using System;
namespace WebViewHelpers
{
public static class WebViewHelper
{
// returns Javascript XPath query string for getting a single element
public static string GetJsSingleXpathString(string xpath)
{
return
using System;
using Awesomium.Core;
namespace AwesomiumNewTest
{
public static class WebViewHelper
{
public static string GetJsSingleXpathString(string xpath)
{