Skip to content

Instantly share code, notes, and snippets.

View codelance's full-sized avatar

Brandon Brisbon codelance

View GitHub Profile
@codelance
codelance / gist:0927980355d026681e4e48afd59f90e5
Last active July 7, 2023 22:26
iOS app ‘<bundle id>’ lacks App ID Prefix. UniversalLinks is not enabled for the app.
https://stackoverflow.com/questions/53755779/issue-with-firebase-dynamic-links
Looks like you’ve encountered an issue while debugging your Firebase Dynamic Link. Just to share, when adding an iOS app to a Firebase project, an OAuth client ID is automatically generated for it in it’s associated Cloud project. Deleting the app doesn't remove its corresponding client IDs, which can cause issues for the dynamic link. Here are the steps to change or delete the package name/bundle ID for the client IDs:
Access the project on the Cloud console
Go to APIs and Services > Credentials
Identify the client ID with the conflicting package name/bundle ID in the name (ex: [Android/iOS] client for (auto created by Google Service)
Edit the package name/bundle ID and save changes or delete the OAuth client ID
@codelance
codelance / Analytics.swift
Last active November 27, 2019 19:25
Segment -> AppsFlyer Integration
func initialize() {
guard let projectId = UIApplication.segmentProjectId else {
return
}
//#if DEBUG
//SEGAnalytics.debug(true)
//#endif
let config = SEGAnalyticsConfiguration(writeKey: projectId)
@codelance
codelance / gist:bc8af631532f636d86dc
Created January 12, 2016 19:34
Use different google-services.json for different app flavors on Android.
def appModuleRootFolder = '.'
def srcDir = 'src'
def googleServicesJson = 'google-services.json'
task switchToStaging(type: Copy) {
outputs.upToDateWhen { false }
def flavor = 'staging'
description = "Switches to $flavor $googleServicesJson"
delete "$appModuleRootFolder/$googleServicesJson"
from "${srcDir}/$flavor/"
Create a new group (www-pub) and add the users to that group
groupadd www-pub
usermod -a -G www-pub usera ## must use -a to append to existing groups
usermod -a -G www-pub userb
groups usera ## display groups for user
@codelance
codelance / NSImage+Rotate.mm
Created February 8, 2013 05:52
I felt this deserved a little more recognition so I am posting it on a public code medium. I was looking for a way to flip a NSImage vertically an horizontally. Thanks buddy @ http://itscoderslife.wordpress.com/2011/03/02/rotate-scale-flip-nsimageview/
- (void)flipImageVertically {
NSAffineTransform *flipper = [NSAffineTransform transform];
NSSize dimensions = self.size;
[self lockFocus];
[flipper scaleXBy:1.0 yBy:-1.0];
[flipper set];
[self drawAtPoint:NSMakePoint(0,-dimensions.height)
fromRect:NSMakeRect(0,0, dimensions.width, dimensions.height)
@codelance
codelance / config.php
Last active April 14, 2018 07:27
Add mailchimp subscribe to woocommerce checkout.
/**
* Subscribe User to MailChimp
*/
function wooms_mailchimp_subscribe_user($order_id,$posted){
if(!empty($_POST['wooms_susbscribe']) && $_POST['wooms_susbscribe'] == '1'){
try{
$email = $posted['billing_email'];
$merge_vars = array('FNAME' => $posted['billing_first_name'],'LNAME' => $posted['billing_last_name']);
$api = new MCAPI(mailchimp_api_key);
import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.SecretKeySpec;
public class AES {
@codelance
codelance / VernamCipher.java
Created December 2, 2012 01:39
Vernam Cipher
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
@codelance
codelance / QuantumKeySimulator
Created December 2, 2012 01:38
Quantum Key Simulator
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Vector;
enum Photon { ZERO, ONE, UNDEFINED; };
class KeyBit {
KeyBit(Photon setBit, String setPol){bit = setBit; polarization = setPol;}
public Photon bit;
public String polarization;
public String toString()
@codelance
codelance / SubstitutionCipher.java
Created December 2, 2012 01:37
Substitution Cipher
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
public class SubstitutionCipher {