Skip to content

Instantly share code, notes, and snippets.

Avatar

Vetle Ledaal vetleledaal

  • Norway
View GitHub Profile
View Games on Steam, 2019-10-04
!Launch_Evolution_RTS.bat: Evolution RTS
!Launch_Evolution_RTS_Offline.bat: Evolution RTS
#WarGames.exe: #WarGames
${Ain_Dodo}.exe: Ain Dodo
${Eslander}.exe: Eslander
${Fares}.exe: Fares
${Kingdom_Shell}.exe: Kingdom Shell Demo
${lasermaze}.exe: Laser Maze
${redagate}.exe: Red Gate
${Soaring_perl_Tom}.exe: Soaring perl Tom
@vetleledaal
vetleledaal / list_twitch.py
Last active Jun 14, 2019
List installed Twitch games.
View list_twitch.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
import winreg
except ImportError:
import _winreg as winreg # Python 2
# Test WOW registry
try:
@vetleledaal
vetleledaal / requests_bind_to_interface.py
Created Feb 24, 2019
Doesn't work on Windows, works on Linux and maybe OS X.
View requests_bind_to_interface.py
import socket
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
class SourceInterfaceAdapter(HTTPAdapter):
def __init__(self, source_interface, **kwargs):
self.source_interface = source_interface
@vetleledaal
vetleledaal / pcgw_export.php
Created Jan 12, 2019
Export all current articles about games from PCGW to xml files.
View pcgw_export.php
<?php
// Find all games on PCGW
echo 'Finding games ...' . PHP_EOL;
$subject = file_get_contents('https://pcgamingwiki.com/wiki/Category:Games');
$all_pages = [];
$all_pages_count = 0;
$i = 0;
do {
@vetleledaal
vetleledaal / create_pcgw_steamid_csv.php
Last active Jan 12, 2019
Creates a csv file containing the article name and main Steam AppID from exports of PCGW.
View create_pcgw_steamid_csv.php
<?php
$fp = fopen('pcgw_steam_ids.csv', 'w');
// For each xml file exported from PCGW ...
foreach(glob('*.xml') as $filename) {
$file_contents = file_get_contents($filename);
// Find every title and steam appid pairs
preg_match_all('%<title>([^<]+)<(?:(?!</text>).)+?\|steam appid\s*= *([^\r\n]*)%sm', $file_contents, $results);
View check_folder_path.php
<?php
$db_text = file_get_contents('DB.csv');
$table = [];
foreach(explode("\n", $db_text) as $line) {
if(strlen($line) != 0) {
$table[] = explode('|', $line);
}
}
View keybase.md

Keybase proof

I hereby claim:

  • I am vetleledaal on github.
  • I am vetleledaal (https://keybase.io/vetleledaal) on keybase.
  • I have a public key ASCDT13c4oFoYPo3Ado7rW8JKv1CxIlvQwexExLdLMxnTAo

To claim this, I am signing this object:

You can’t perform that action at this time.