Skip to content

Instantly share code, notes, and snippets.

View michaelbutler's full-sized avatar
💥
Reticulating splines...

Michael Butler michaelbutler

💥
Reticulating splines...
View GitHub Profile
@michaelbutler
michaelbutler / Steam_Proton_Exe.md
Last active April 24, 2024 06:49
How to run another .exe in an existing proton wine prefix

Running games through Steam's Proton is great. But what if there is a secondary exe or configuration application bundled with the game? How can you launch it if Steam itself only launches the game?

Simply run this command in a terminal:

cd /path/to/steam/steamapps/compatdata/20920/pfx

STEAM_COMPAT_DATA_PATH="/path/to/steam/steamapps/compatdata/20920" WINEPREFIX=$PWD \
    "$HOME/.steam/root/steamapps/common/Proton 5.0/proton" run ./drive_c/path/to/custom_application.exe
@michaelbutler
michaelbutler / Witcher_3_Linux_Easy_README.md
Last active October 17, 2023 10:18
Install and Play The Witcher 3 Complete Edition (GOG & GOG Galaxy) on Ubuntu Linux 20.04 with Lutris.net and Wine

How to install and play The Witcher 3 (GOG Edition) on Linux

It's really quite simple!

Step 1: Buy The Witcher 3 on gog.com

Simply go to https://www.gog.com/game/the_witcher_3_wild_hunt_game_of_the_year_edition (this should also work with the regular edition) and buy and add the game to your library.

Do NOT click "Download and Install" at this point. We will do this through Lutris.

<?php
use GuzzleHttp\Handler\EasyHandle;
/**
* Extends Guzzle's CurlFactory package to enable better control of garbage collection after connections
* are no longer needed.
*/
class MyCurlFactory extends \GuzzleHttp\Handler\CurlFactory
{
#!/usr/bin/php
<?php
use GuzzleHttp\Client;
use Psr\Http\Message\ResponseInterface;
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('error_log', null); // error_log to stderr
@michaelbutler
michaelbutler / guzzletest.php
Created March 13, 2019 02:47
This test script causes file descriptors to stay open until the process quits, even though the local variables all should be cleared out.
#!/usr/bin/php
<?php
use GuzzleHttp\Client;
use Psr\Http\Message\ResponseInterface;
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('error_log', null); // error_log to stderr
@michaelbutler
michaelbutler / instructions.md
Created April 3, 2018 02:43
Guide to Intercept & Inspect SSL or HTTPS requests from an Android App Using a Free Emulator

This guide will take you from start to finish: how to inspect (intercept) SSL (or normal) web requests using Ubuntu 16.04 LTS (Linux). Everything in this guide is free and can be legally obtained.

Components:

  • Android Studio (comes with built in Emulator)
  • Burp Suite Community Edition
  • Terminal

Step 1: Install Android Studio

<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1519158109">
<project timestamp="1519158109">
<package name="MyProj\One">
<file name="/Users/testuser/tmp/phpunit-issue-testing/src/One/One.php">
<class name="MyProj\One\One" namespace="MyProj\One">
<metrics complexity="5" methods="3" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="8" coveredstatements="4" elements="11" coveredelements="5"/>
</class>
<line num="34" type="method" name="__construct" visibility="public" complexity="2" crap="2.06" count="1"/>
<line num="36" type="stmt" count="1"/>
@michaelbutler
michaelbutler / balance.scala
Last active July 21, 2017 22:01
solution for "count change" problem
def balance(chars: List[Char]): Boolean = {
def inner(chars: List[Char], sum: Int): Boolean = {
if (chars.isEmpty)
sum == 0
else {
val c = chars.head.toString()
var newSum = sum
if (c.equals("("))
newSum += 1
else if (c.equals(")"))