Skip to content

Instantly share code, notes, and snippets.

View gfdac's full-sized avatar

Gustavo Clemente gfdac

View GitHub Profile

How to install game-porting-toolkit (aka proton for macOS)

You also might wanna just use Whisky which does this automatically

This guide works on macOS 13.4+ using Command Line Tools for XCode 15 Beta!

What is this?

In the recent WWDC, Apple announced and released the "game porting toolkit", which upon further inspection this is just a modified version of CrossOver's fork of wine which is a "compatibility layer" that allows you to run Windows applications on macOS and Linux.

@gfdac
gfdac / gist:dac02c0b2e78d84b267bc070a97175dc
Created June 28, 2021 03:53
Swift 5 Kingfisher Library refactory
if(settings.imageUrl.hasValue){
let resource = ImageResource(downloadURL: URL.specialURL(specialString: settings.imageUrl!))
let options = [KingfisherOptionsInfoItem.cacheOriginalImage]
logoImageView?.kf.setImage(with: resource, options: options, completionHandler: { (result) in
DispatchQueue.main.async{
DispatchQueue.main.async {
let image = try? result.get().image
if let image = image {
let imgSize = self.logoImageView?.frame.size ?? CGSize(width: 0, height: 0)
let imgCropped = image.resizeTopLeftToFill(containerSize : imgSize)
@gfdac
gfdac / patch_apk_for_sniffing.md
Created March 21, 2021 21:06 — forked from unoexperto/patch_apk_for_sniffing.md
How to patch Android app to sniff its HTTPS traffic with self-signed certificate

How to patch Android app to sniff its HTTPS traffic with self-signed certificate

  • Download apktool from https://ibotpeaches.github.io/Apktool/
  • Unpack apk file: java -jar /home/expert/work/tools/apktool.jar d net.flixster.android-9.1.3@APK4Fun.com.apk
  • Modify AndroidManifest.xml by adding android:networkSecurityConfig="@xml/network_security_config" attribute to application element.
  • Create file /res/xml/network_security_config.xml with following content:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config>
@gfdac
gfdac / client.cpp
Created March 20, 2021 23:47 — forked from mht/client.cpp
JUCE InterprocessConnection Demo : Client
const int kPortNumber = 52713;
class Connection : public InterprocessConnection
{
public:
Connection()
: InterprocessConnection(false, 15)
{
}
@gfdac
gfdac / server.cpp
Created March 20, 2021 23:47 — forked from mht/server.cpp
JUCE InterprocessConnection Demo : Server
const int kPortNumber = 52713;
class Connection : public InterprocessConnection
{
public:
Connection(WaitableEvent& stop_signal)
: InterprocessConnection(false, 15),
stop_signal_(stop_signal)
{
}
@gfdac
gfdac / clock_sync.txt
Created January 29, 2021 03:50 — forked from darinwilson/clock_sync.txt
Sonic Pi MIDI clock sync
use_bpm 120
midi_start
live_loop :clock do
midi_clock_beat
sleep 1
end
live_loop :kick do
sample :bd_haus
@gfdac
gfdac / aes_example.cs
Created October 27, 2020 23:54 — forked from mark-adams/aes_example.cs
AES String Encryption (CBC) Example Code for C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace aes_example
{
using System;
@gfdac
gfdac / AesCipher.java
Created June 5, 2020 01:59 — forked from demisang/AesCipher.java
AES/CBC/PKCS5Padding encrypt/decrypt PHP and JAVA example classes
import android.support.annotation.Nullable;
import android.util.Base64;
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;