Skip to content

Instantly share code, notes, and snippets.

View federicocappelli's full-sized avatar

Federico Cappelli federicocappelli

View GitHub Profile
@Omar-Ikram
Omar-Ikram / EndpointSecurityDemo.m
Last active April 6, 2024 08:56
A demo of using Apple's EndpointSecurity framework - tested on macOS Monterey 12.2.1 (21D62)
//
// main.m
// EndpointSecurityDemo
//
// Created by Omar Ikram on 17/06/2019 - macOS Catalina 10.15 Beta 1 (19A471t)
// Updated by Omar Ikram on 15/08/2019 - macOS Catalina 10.15 Beta 5 (19A526h)
// Updated by Omar Ikram on 01/12/2019 - macOS Catalina 10.15 (19A583)
// Updated by Omar Ikram on 31/01/2021 - macOS Big Sur 11.1 (20C69)
// Updated by Omar Ikram on 07/05/2021 - macOS Big Sur 11.3.1 (20E241)
// Updated by Omar Ikram on 04/07/2021 - macOS Monterey 12 Beta 2 (21A5268h)
@proxpero
proxpero / Iso3166_1a2.swift
Last active February 20, 2024 16:44
A Swift 4.0 enum representing ISO 3166-1 alpha-2 (two letter country codes) Includes properties for country name and unicode flag.
// taken 2018-03-19 from wikipedia. https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
enum Iso3166_1a2: String {
case af = "AF"
case ax = "AX"
case al = "AL"
case dz = "DZ"
case `as` = "AS"
case ad = "AD"
case ao = "AO"
@davedarko
davedarko / deauther_killer.ino
Created January 16, 2018 17:20
Arduino Script to auto connect to deauthers by spacehuhn with standard passwords and replaces them with whatever you want.
#include <ESP8266WiFi.h>
WiFiClient client;
const char* ssid = "pwned";
const char* password = "deauther";
const char* host = "192.168.4.1";
void setup()
{
Serial.begin(115200);
@kcharwood
kcharwood / upload_to_simplemdm.rb
Created October 10, 2017 18:31
SimpleMDM Fastlane Action
require "SimpleMDM"
module Fastlane
module Actions
module SharedValues
end
class UploadToSimplemdmAction < Action
def self.run(params)
SimpleMDM.api_key = "#{params[:api_key]}"
@Sorix
Sorix / AsynchronousOperation.swift
Last active June 15, 2023 10:50
Subclass of NSOperation (Operation) to make it asynchronous in Swift 3, 4, 5
// Created by Vasily Ulianov on 09.02.17, updated in 2019.
// License: MIT
import Foundation
/// Subclass of `Operation` that adds support of asynchronous operations.
/// 1. Call `super.main()` when override `main` method.
/// 2. When operation is finished or cancelled set `state = .finished` or `finish()`
open class AsynchronousOperation: Operation {
public override var isAsynchronous: Bool {
@skywinder
skywinder / create_fat_framework.sh
Last active October 14, 2018 15:41
Export “fat” Cocoa Touch Framework (for Simulator and Device)
#run this script from Product page in your project Derived Data folder
framework_name="${$(basename $(find ./Debug-iphoneos -type d -name '*.framework' -maxdepth 1))%.*}" && \
cp -R Debug-iphoneos/$framework_name.framework ./$framework_name.framework && \
lipo -create -output "$framework_name.framework/$framework_name" \
"Debug-iphonesimulator/$framework_name.framework/$framework_name" \
"Debug-iphoneos/$framework_name.framework/$framework_name"
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh