Skip to content

Instantly share code, notes, and snippets.

@skymobilebuilds
skymobilebuilds / carthage-xc12.sh
Last active May 17, 2022 12:36
Xcode 13 and 12 Carthage Build Workaround
#!/bin/bash -e
echo "🤡 Applying carthage 12 and 13 workaround 🤡"
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' > $xcconfig
echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig
@ozgur
ozgur / AlamofireObjectMapper+Rx.swift
Last active March 7, 2019 20:52
AlamofireObjectMapper+Rx.swift
//
// AlamofireObjectMapper+Rx.swift
// AlamofireObjectMapper
//
// Created by Ozgur on 28/01/2017.
// Copyright © 2017 Ozgur. All rights reserved.
//
import AlamofireObjectMapper
import Alamofire
@ravibhure
ravibhure / git_rebase.md
Last active June 4, 2024 15:02
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@huseyinyilmaz
huseyinyilmaz / median_of_two_sorted_arrays.py
Created April 27, 2016 20:38
Find the median of two sorted arrays
# https://leetcode.com/problems/median-of-two-sorted-arrays/
from bisect import bisect_left
from itertools import takewhile
class Solution(object):
def count_prefix(self, start_idx, st, char):
""" Starting from the start index, checks how many times given character
repeated"""
//: #typealias & associatedtype magic
//: ##Let's make a protocol without typealias (now associatedtype)
protocol Testable {
}
//: ##And another one with typealias
//: You could think, that the below typealias is just making
//: a typealiast for Int. In fact, we actually created a
@staltz
staltz / introrx.md
Last active June 15, 2024 12:24
The introduction to Reactive Programming you've been missing
@lukaszb
lukaszb / notify.py
Created February 21, 2013 01:23
Simple Python script to send notification to the OSX Notifications Center (requires OS X 10.8+). Tested with pyobjc 2.5.1
#!/usr/bin/env python
from Foundation import NSUserNotification
from Foundation import NSUserNotificationCenter
from Foundation import NSUserNotificationDefaultSoundName
from optparse import OptionParser
def main():
parser = OptionParser(usage='%prog -t TITLE -m MESSAGE')