Skip to content

Instantly share code, notes, and snippets.

View pschneider's full-sized avatar
🎯
Focusing

Patrick Schneider pschneider

🎯
Focusing
  • Germany
View GitHub Profile
@groovelab
groovelab / 0 run PerfectLib(FastCGI) with nginx.md
Last active May 23, 2016 20:33
PerfectのExampleをFastCGIでnginxから動かす
@steventroughtonsmith
steventroughtonsmith / Tweak.xm
Created October 14, 2015 06:33
iOS 9 Enable Splitscreen Jailbreak Tweak (Theos)
/* How to Hook with Logos
Hooks are written with syntax similar to that of an Objective-C @implementation.
You don't need to #include <substrate.h>, it will be done automatically, as will
the generation of a class list and an automatic constructor.
%hook ClassName
// Hooking a class method
+ (id)sharedInstance {
@rbobbins
rbobbins / ui_testing_in_xcode.md
Last active February 23, 2018 08:28
UI Testing in Xcode

Wil Turner, Brook Callhan: Speakers

##3 Main components/concepts that enable UI Testing:##

  • UITesting
    • Find and interact w/ UI elements
    • Validate UI properties and state
  • UIrecording
    • Updated test reports to include UI testing data
    • UI testing is enabled by XCTest and UI Accesibility
@evgenyneu
evgenyneu / undo_ios_carthage_except.sh
Last active August 21, 2018 15:23
Undo frameworks built by Carthage except the one given framework
#!/bin/sh
#
# Script for Xcode and Carthage
# ------------------------------
#
# Dismisses changes to all the frameworks except the given frameworks in the iOS build folder.
# This is used to undo the changes done to the framework build after `carthage update` command.
#
#
@jackreichert
jackreichert / getKeyVals
Last active March 19, 2020 07:12
This is a swift extension for NSURL so you can parse the query string and get back a dictionary of the variables.
extension NSURL {
func getKeyVals() -> Dictionary<String, String>? {
var results = [String:String]()
var keyValues = self.query?.componentsSeparatedByString("&")
if keyValues?.count > 0 {
for pair in keyValues! {
let kv = pair.componentsSeparatedByString("=")
if kv.count > 1 {
results.updateValue(kv[1], forKey: kv[0])
}
@yimingtang
yimingtang / create_merge_request.rb
Created December 27, 2016 07:49
A fastlane action to create a new merge request on GitLab
module Fastlane
module Actions
module SharedValues
CREATE_MERGE_REQUEST_WEB_URL = :CREATE_MERGE_REQUEST_WEB_URL
end
class CreateMergeRequestAction < Action
def self.run(params)
require 'excon'
@saiday
saiday / RxSwiftExample.swift
Last active February 23, 2022 06:03
RxSwift callback chaining
func fetchUserId() -> Observable<String> {
return create{ (observer) -> Disposable in
Client.fetchUserId() { [unowned self]
(userId: String?, err: ErrorType?) -> Void in
if let _ = err{
observer.on(Event.Error(err!))
} else {
observer.on(Event.Next(userId))
observer.on(Event.Completed)
}
@navsing
navsing / clubhouse.swift
Created February 11, 2021 21:22
Recreating ClubHouse in SwiftUI with Dark Mode
//
// Clubhouse.swift
// Playground
//
// Created by Nav Singh on 2/11/21.
//
import SwiftUI
struct Clubhouse: View {
@danahartweg
danahartweg / test-firestore-on-ci.sh
Last active September 30, 2022 04:10
Running the firestore emulator in a CI environment without IPv6
#!/bin/sh
EMULATOR="cloud-firestore-emulator"
EMULATOR_TARGET=$(find ~/.cache/firebase/emulators/ -type f -name "$EMULATOR*.jar" | sort -r | head -n1)
if [ -z "$EMULATOR_TARGET" ]; then
echo "Could not find the firestore emulator. Ending test run."
exit 1
fi
@kharrison
kharrison / CoreDataController.swift
Last active January 31, 2023 22:36
Swift wrapper for NSPersistentContainer - Easy Core Data Setup with iOS 10
//
// CoreDataController.swift
//
// Created by Keith Harrison http://useyourloaf.com
// Copyright (c) 2017 Keith Harrison. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright