Skip to content

Instantly share code, notes, and snippets.

View BandarHL's full-sized avatar
💭
I may be slow to respond.

BandarHelal BandarHL

💭
I may be slow to respond.
View GitHub Profile
@PoomSmart
PoomSmart / ReadEntitlements.x
Last active February 16, 2022 23:11
Read the entitlements of iOS application at run-time
#import <substrate.h>
#import <HBLog.h>
typedef struct __CFRuntimeBase {
uintptr_t _cfisa;
uint8_t _cfinfo[4];
#ifdef __LP64__
uint32_t _rc;
#endif
} CFRuntimeBase;
@darcyliu
darcyliu / ClassesList.m
Created September 4, 2019 09:18
List all image names and class names
#import <objc/runtime.h>
NSArray *AllImageNames() {
unsigned int imageCount = 0;
const char **imageNames = objc_copyImageNames(&imageCount);
NSMutableArray<NSString *> *imageNameStrings = [[NSMutableArray alloc] initWithCapacity:imageCount];
if (imageNames!=NULL) {
for (unsigned int i = 0; i < imageCount; i++){
const char *imageName = imageNames[i];
NSLog(@"image name: %s", imageNames[i]);
@standinga
standinga / AudioPlayground.swift
Last active May 13, 2024 21:01
Swift Playground shows how to play multiple wav files on top of background audio file, using AVAudioPlayerNode, AVAudioMixerNode, AVAudioEngine
import AVFoundation
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
class AudioPlayer {
var backgroundAudioFile:AVAudioFile
var topAudioFiles: [AVAudioFile] = []
@mrispoli24
mrispoli24 / setting-up-heroku-and-cloudflare.md
Created October 15, 2018 18:41
Setting up Heroku and Cloudflare (the right way)

Setting up Heroku and Cloudflare (the right way)

The following outlines how to setup Heroku + Cloudflare with a full SSL certificate. What this means is that communication between the browser and the Cloudflare CDN is encrypted as well as communication between Cloudflare and Heroku’s origin server. Follow these steps exactly and the setup is a breeze.

Step 1: Set up domain names in Heroku

First you want to add the root domain and the www domain to heroku. You do this by clicking into your production application, then going to settings and then scrolling down to Domains and certificates.

Here you will add <your_domain>.com and www.<your_domain>.com. This will give you two CNAME records. They will look something like <your_domain>.com.herokudns.com and www.<your_domain>.com.herokudns.com.

Step 2: Add CNAME records to Cloudfare.

@algal
algal / ScaleAspectFitImageView.swift
Last active September 24, 2023 10:19
UIImageView subclass that works with Auto Layout to express its desired aspect ratio
import UIKit
// known-good: Xcode 8.2.1
/**
UIImageView subclass which works with Auto Layout to try
to maintain the same aspect ratio as the image it displays.
This is unlike the usual behavior of UIImageView, where the
@cmoulton
cmoulton / Custom HTTP Headers with Swift and Alamofire.swift
Last active July 15, 2022 12:37
Custom HTTP Headers with Swift 3 or 4 and Alamofire 4.0-4.7: See https://grokswift.com/custom-headers-alamofire4-swift3/ for explanations
// MARK: - Adding a header to a single request
func doRequestWithHeaders1() {
let headers: HTTPHeaders = [
"X-Mashape-Key": MY_API_KEY,
"Accept": "application/json"
]
Alamofire.request("https://mashape-community-urban-dictionary.p.mashape.com/define?term=smh", headers: headers)
.responseJSON { response in
debugPrint(response)
#using scripts\codescripts\struct;
#using scripts\shared\callbacks_shared;
#insert scripts\shared\shared.gsh;
#insert scripts\zm\_zm_utility.gsh;
//Perks
#using scripts\zm\_zm_perks;
//include these because not all maps have them
#using scripts\zm\_zm_perk_deadshot;