Skip to content

Instantly share code, notes, and snippets.

View lacostej's full-sized avatar

Jerome Lacoste lacostej

View GitHub Profile
@lacostej
lacostej / inject_platforms.rb
Created February 1, 2017 18:27
Support moooar platforms
module Fastlane
class SupportedPlatforms
@@previous = Fastlane::SupportedPlatforms.all
class << self
attr_accessor :extra
end
@extra = []
def self.all
@lacostej
lacostej / UnityProgress_2017.1.js
Created January 15, 2018 15:32
Unity WebGL progress bar template for Unity 2017.1
// https://docs.unity3d.com/2017.1/Documentation/Manual/webgl-templates.html example code is broken. Use:
function UnityProgress(gameInstance, progress) {
if (!gameInstance.Module)
return;
var r = UnityLoader.Progress.Styles[gameInstance.Module.splashScreenStyle],
n = gameInstance.Module.progressLogoUrl ? gameInstance.Module.resolveBuildUrl(gameInstance.Module.progressLogoUrl) : r.progressLogoUrl,
o = gameInstance.Module.progressEmptyUrl ? gameInstance.Module.resolveBuildUrl(gameInstance.Module.progressEmptyUrl) : r.progressEmptyUrl,
i = gameInstance.Module.progressFullUrl ? gameInstance.Module.resolveBuildUrl(gameInstance.Module.progressFullUrl) : r.progressFullUrl,
a = "position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);";
if (!gameInstance.logo) {
@lacostej
lacostej / gist:504d07c182de6507f865a38cde2d3a91
Created January 16, 2018 12:40
DotNet 4.6 TLS broken in Unity 2017.2/3.
DllNotFoundException: CoreFoundation
Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (System.IAsyncResult asyncResult) (at <eb1224ae7b184cd09343d47f8a05481b>:0)
Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (System.IAsyncResult ar, System.Boolean ignoreEmpty) (at <eb1224ae7b184cd09343d47f8a05481b>:0)
Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (System.IAsyncResult result) (at <eb1224ae7b184cd09343d47f8a05481b>:0)
Rethrow as IOException: The authentication or decryption has failed.
Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (System.IAsyncResult result) (at <eb1224ae7b184cd09343d47f8a05481b>:0)
Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (System.IAsyncResult asyncResult) (at <eb1224ae7b184cd09343d47f8a05481b>:0)
Rethrow as IOException: The authentication or decryption has failed.
Mono.Security.Protocol.Tls.SslStreamBase.EndRead (System.IAsyncResult asyncResult) (at <eb1224ae7b184cd09343d47f8a05481b>:0)
Mono.Net.Security.P
@lacostej
lacostej / force_prune_bitbucket.sh
Created January 24, 2018 13:43
Force pruning of a bitbucket repo
# bitbucket reposize not the same as you see locally?
# run this once in a while to force GC on your bitbucket repo.
# run it BEFORE you reach your 2G limit of course.
# see https://confluence.atlassian.com/bitbucket/reduce-repository-size-321848262.html#Reducerepositorysize-Removetherepositorylimitation
git pull
touch bitbucket_should_prune_automatically
git add bitbucket_should_prune_automatically
git commit -m "But we need to force it by doing weird stuff"
git push
git reset --hard HEAD^1
@lacostej
lacostej / fastlane_openssl_migration_test.rb
Created January 5, 2024 16:29
Experiment with AES-256-GCM and proposed migration to fastlane's match encryption
require 'openssl'
require 'securerandom'
require 'base64'
class OldEncryption
ALGORITHM = 'aes-256-cbc'
def encrypt(data, password, salt)
cipher = ::OpenSSL::Cipher::Cipher.new(ALGORITHM)
cipher.encrypt