Skip to content

Instantly share code, notes, and snippets.

View vetleledaal's full-sized avatar

Vetle Ledaal vetleledaal

View GitHub Profile
!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 June 14, 2019 02:15
List installed Twitch games.
#!/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 February 24, 2019 22:40
Doesn't work on Windows, works on Linux and maybe OS X.
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 January 12, 2019 21:05
Export all current articles about games from PCGW to xml files.
<?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 January 12, 2019 21:03
Creates a csv file containing the article name and main Steam AppID from exports of PCGW.
<?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);
<?php
$db_text = file_get_contents('DB.csv');
$table = [];
foreach(explode("\n", $db_text) as $line) {
if(strlen($line) != 0) {
$table[] = explode('|', $line);
}
}

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: