Skip to content

Instantly share code, notes, and snippets.

View VivienGiraud's full-sized avatar
🏒
Freelancing

Vivien Giraud VivienGiraud

🏒
Freelancing
View GitHub Profile
@aquajach
aquajach / NSMutableAttributedString+Extend.swift
Last active June 2, 2021 21:31
Swift: Highlight matched text in String between square brackets
import UIKit
extension NSMutableAttributedString {
func highlightTarget(target: String, color: UIColor) -> NSMutableAttributedString {
let targetValue = String(target.characters.dropFirst().dropLast())
let regPattern = "\\[\(targetValue)\\]"
if let regex = try? NSRegularExpression(pattern: regPattern, options: []) {
let matchesArray = regex.matchesInString(self.string, options: [], range: NSRange(location: 0, length: self.length))
for match in matchesArray {
@JamalK
JamalK / facetime_cli.swift
Last active October 13, 2022 06:16
FaceTime from command line.
#!/usr/bin/env swift
//swiftc facetime_cli.swift -o facetime_cli
// sudo cp facetime_cli /usr/bin
// Enjoy! usage: facetime_cli $PHONE_NUMBER or $APPLE_ID
import Foundation
import Cocoa
extension Array {
@rvanbruggen
rvanbruggen / loadgtfs.cql
Last active April 17, 2024 22:45
Loading and Querying GTFS data
//LOAD CSV script for GFTS data
create constraint on (a:Agency) assert a.id is unique;
create constraint on (r:Route) assert r.id is unique;
create constraint on (t:Trip) assert t.id is unique;
create index on :Trip(service_id);
create constraint on (s:Stop) assert s.id is unique;
create index on :Stoptime(stop_sequence);
create index on :Stop(name);
schema await
@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active January 28, 2025 09:47
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7
/*
nfc_creditcard_reader by Jose Miguel Esparza (jesparza AT eternal-todo.com)
http://eternal-todo.com
Based on the PoC readnfccc by Renaud Lifchitz ([email protected])
Fixed to work with libnfc 1.7.4 by bluec0re
License: distributed under GPL version 3 (http://www.gnu.org/licenses/gpl.html)
@anthony-dandrea
anthony-dandrea / iOSHack.md
Last active June 28, 2022 07:48
How to pop iOS locks

Pop App Locks

For these hacks the iPhone must be jailbroken. But there currently is a jailbreak available for iOS 8.4 and some below. 4 digit pins can be bruteforced unless there is a attempt limit. Even with the limit it can still be hacked but you would need to break the phone open to rig the power to cut before the attempt is registered. Example here.

For all of these you need:

  • Phone to be jailbroken
  • OpenSSH installed on the phone

###1) Dump the iOS Keychain

/**************************************************************************/
/*!
This example attempts to dump the contents of a Mifare Ultralight card
Note that you need the baud rate to be 115200 because we need to print
out the data and read from the card at the same time!
To enable debug message, define DEBUG in PN532/PN532_debug.h
Edited by Sam Decrock to read out Mifare Ultralight cards
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 29, 2025 02:22
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@ncerezo
ncerezo / FileUploader.swift
Last active November 30, 2022 03:17
Alamofire multipart upload
//
// FileUploader.swift
//
// Copyright (c) 2015 Narciso Cerezo Jiménez. All rights reserved.
// Largely based on this stackoverflow question: http://stackoverflow.com/questions/26121827/uploading-file-with-parameters-using-alamofire/28467829//
import Foundation
import Alamofire
private struct FileUploadInfo {