Skip to content

Instantly share code, notes, and snippets.

View rustymagnet3000's full-sized avatar
🧵

Rusty Magnet rustymagnet3000

🧵
View GitHub Profile
@mattmichal
mattmichal / main.tf
Created October 7, 2022 11:31
Sample Terraform code that uses Cloudflare provider version 3.25.0 to perform operations on resources that require API token as well as API user service key. Secrets are passed to Terraform via TF_VAR environment variables. Two providers are configured and then both are passed to a local module.
module "app" {
for_each = local.applications.customers
source = "./modules/app/"
customer_name = each.key
providers = {
cloudflare = cloudflare
cloudflare.user_service_key = cloudflare.user_service_key
}
}
@joncardasis
joncardasis / jailbreak_protect.c
Last active May 26, 2024 22:38
iOS - Prevent debugger attachment in a jailbroken environment. Obfuscated by assembly and symbol mangling.
//
// jailbreak_protect.c
//
// Created by Jonathan Cardasis (C) on 10/11/19.
// Copyright © 2019 Jonathan Cardasis (C). All rights reserved.
//
// Source: https://medium.com/@joncardasis/mobile-security-jailbreak-protection-84aa0fbc7b23
// Simply include this file in your project and ensure the file's Target Membership
// is set to your app.
@steinwaywhw
steinwaywhw / AWS Lambda: Hello World.md
Last active March 8, 2022 10:40
An extremely simple AWS Lambda example in Python 3.

Preface

In general, AWS services can be accessed using

  1. AWS web interface,
  2. API libraries in a programming language, such as boto3 for Python 3,
  3. AWS command-line interface, i.e. awscli.

I opted for the API library since it is

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active November 15, 2024 17:43
set -e, -u, -o, -x pipefail explanation
@mayoff
mayoff / !README.md
Last active August 14, 2023 15:09
Debugging Objective-C blocks in lldb

The attached lldb command pblock command lets you peek inside an Objective-C block. It tries to tell you where to find the source code for the block, and the values captured by the block when it was created.

Consider this example program:

#import <Foundation/Foundation.h>

@interface Foo: NSObject
@end

@implementation Foo

@beatfactor
beatfactor / install_nginx_macos_source.md
Last active October 24, 2024 05:48
Install Nginx on Mac OS from source (without brew)

Install Nginx on Mac OS from source

no Homebrew required

1. Download Nginx

$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
@jeffery812
jeffery812 / AsyncOperation
Last active March 31, 2020 16:52
AsyncOperation: Wrap Asynchronous Function in Operation For synchronous tasks, you can create an Operation subclass by overriding the main() method. AsyncOperation is a custom subclass of Operation that handles state changes automatically. Then, to
class AsyncOperation: Operation {
enum State: String {
case Ready, Executing, Finished
fileprivate var keyPath: String {
return "is" + rawValue
}
}
var state = State.Ready {
@sahara-ooga
sahara-ooga / HaveXcode9RenderMarkdown.md
Created November 26, 2017 09:18
Have Xcode 9 render markdown

Have Xcode 9 render markdown

To make Xcode 9 render markdown file eg. README.md, drop .xcodesamplecode.plist in your .xcodeproj/ folder. .xcodesamplecode.plist is like this:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array/> </plist>

For convenience, There is this tool, which is derived from a tutorial.