Skip to content

Instantly share code, notes, and snippets.

View mayoralito's full-sized avatar
:octocat:
This is the way!

amayoral mayoralito

:octocat:
This is the way!
View GitHub Profile
@geek-at
geek-at / trash.sh
Created August 13, 2020 07:27
The script used to trash a banking phishing site
#!/bin/bash
while :; do
verf=$(cat /dev/urandom | tr -dc '0-9' | fold -w 8 | head -n 1)
pin=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
ip=$(printf "%d.%d.%d.%d\n" "$((RANDOM % 256))" "$((RANDOM % 256))" "$((RANDOM % 256))" "$((RANDOM % 256))")
@zhihuitang
zhihuitang / OCCatch.h
Last active June 10, 2019 04:06
How to properly catch NSExceptions in Swift?
//
// OCCatch.h
//
//
#ifndef OCCatch_h
#define OCCatch_h
// add the code below to your -Bridging-Header.h
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@natecook1000
natecook1000 / operatorCharacters.swift
Last active January 3, 2024 21:33
Allowed characters for Swift operators
import Foundation
extension UnicodeScalar : ForwardIndexType {
public func successor() -> UnicodeScalar {
return UnicodeScalar(value + 1)
}
}
var operatorHeads: [UnicodeScalar] = Array("=-+!*%<>&|^~?".unicodeScalars)
operatorHeads += Array("\u{00A1}" ... "\u{00A7}")
@jacks205
jacks205 / timeago.swift
Last active October 15, 2018 21:54 — forked from minorbug/timeago.swift
"Time ago" function for Swift (based on MatthewYork's DateTools for Objective-C) *Swift 2
func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String {
let calendar = NSCalendar.currentCalendar()
let now = NSDate()
let earliest = now.earlierDate(date)
let latest = (earliest == now) ? date : now
let components:NSDateComponents = calendar.components([NSCalendarUnit.Minute , NSCalendarUnit.Hour , NSCalendarUnit.Day , NSCalendarUnit.WeekOfYear , NSCalendarUnit.Month , NSCalendarUnit.Year , NSCalendarUnit.Second], fromDate: earliest, toDate: latest, options: NSCalendarOptions())
if (components.year >= 2) {
return "\(components.year) years ago"
} else if (components.year >= 1){
@CodaFi
CodaFi / alltheflags.md
Last active October 26, 2022 20:09
Every Option and Flag /swift (1.2) Accepts Ever

#Every Single Option Under The Sun

  • optimization level options
  • automatic crashing options
  • debug info options
  • swift internal options
  • swift debug/development internal options
  • linker-specific options
  • mode options
@Ashton-W
Ashton-W / Breakpoints_v2.xcbkptlist
Last active January 25, 2023 09:28
My User Breakpoints_v2.xcbkptlist
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "2"
version = "2.0">
<Breakpoints>
<!-- All Exceptions -->
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
@JadenGeller
JadenGeller / Matrix Examples.swift
Last active August 10, 2023 10:03
Matrices in Swift
// Numerical matrix examples
let x: Matrix = [[10, 9, 8], [3, 2, 1]]
let y: Matrix = [[1, 2, 3], [4, 5, 6]]
let z: Matrix = [[1, 2], [3, 4], [5, 6]]
x + y // [[11, 11, 11], [7, 7, 7]]
x * y // [[10, 18, 24], [12, 10, 6]]
2 * x // [[20, 18, 16], [6, 4, 2]]
y ** z // [[22, 28], [49, 64]]
@ZevEisenberg
ZevEisenberg / resetAllSimulators.sh
Last active November 30, 2022 09:27
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@ryanchang
ryanchang / lldb_cheat_sheet.md
Last active March 12, 2024 11:03
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type