Skip to content

Instantly share code, notes, and snippets.

View priore's full-sized avatar

Prioregroup.com priore

View GitHub Profile
@sn1p3r46
sn1p3r46 / TP-Link_TD-W8960N_Reboot.sh
Last active November 29, 2020 15:23
This bash script reboots TP-Link routers
@lifeisfoo
lifeisfoo / NSURLSessionPinningDelegate.swift
Created March 3, 2016 18:47
Swift version of OWASP's didReceiveAuthenticationChallenge method (for ios SSL PINNING) (complete method http://stackoverflow.com/a/34223292/3340702)
import Foundation
import Security
class NSURLSessionPinningDelegate: NSObject, NSURLSessionDelegate {
func URLSession(session: NSURLSession, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) {
// Adapted from OWASP https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning#iOS
if (challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust) {
@JARinteractive
JARinteractive / WaitUntil.swift
Last active September 4, 2022 14:40
wait for condition to be true
// https://gist.github.com/JARinteractive/7fb33b6b0043f365ddfd
import Foundation
import XCTest
@discardableResult
public func AssertEventuallyTrue(file: StaticString = #file, line: UInt = #line, _ checkSuccess: @autoclosure () -> Bool) -> Bool {
    return AssertEventuallyTrue(10.0, file: file, line: line, checkSuccess)
}
@discardableResult
@nlutsenko
nlutsenko / yolo.sh
Last active April 18, 2025 19:25
Fast Xcode builds
defaults write xcodebuild PBXNumberOfParallelBuildSubtasks 4
defaults write xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4
defaults write com.apple.xcode PBXNumberOfParallelBuildSubtasks 4
defaults write com.apple.xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4
@mw-ferretti
mw-ferretti / README.md
Last active January 28, 2023 20:44
Paypal button on markdown github

Steps:

<!-- Sample of code generated --> 
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="RGQ8NSYPA59FL">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/pt_BR/i/scr/pixel.gif" width="1" height="1">
@alexcurylo
alexcurylo / ThreadsafeDF.m
Created February 16, 2015 02:30
Threadsafe Date Formatting
+ (NSDateFormatter *)dateReader
{
NSMutableDictionary *dictionary = [[NSThread currentThread] threadDictionary];
NSDateFormatter *dateReader = [dictionary objectForKey:@"SCDateReader"];
if (!dateReader)
{
dateReader = [[[NSDateFormatter alloc] init] autorelease];
dateReader.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease];
dateReader.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0];
dateReader.dateFormat = @"EEE, dd MMM yyyy HH:mm:ss Z";
@vitorbritto
vitorbritto / rm_mysql.md
Last active May 6, 2025 19:35
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@cromandini
cromandini / universal-framework.sh
Last active November 9, 2024 08:56 — forked from cconway25/gist:7ff167c6f98da33c5352
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures).
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
@ideabucket
ideabucket / README.md
Last active December 30, 2022 15:53
BBEdit text filter to replace Markup → Tidy → Reflow XML

As of BBEdit 13.1, the HTML Tidy built-ins are back and you should use those instead. This gist is so old it refers to "OS X", c’mon!

If for some reason you are using this, note @ryanfrancesconi’s comment about the correct place to put the file when using sandboxed versions of BBEdit.

@jonathantneal
jonathantneal / README.md
Last active March 24, 2025 17:47
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"