Skip to content

Instantly share code, notes, and snippets.

View soheilbm's full-sized avatar
🐢
I may be slow to respond.

Soheil soheilbm

🐢
I may be slow to respond.
View GitHub Profile
@RichardBronosky
RichardBronosky / resign.sh
Last active April 16, 2023 02:29
A simple tool for resigning an iOS app ipa with a new certificate/mobileprovision
#!/usr/bin/env bash
if [[ ! ( # any of the following are not true
# 1st arg is an existing regular file
-f "$1" &&
# ...and it has a .ipa extension
"${1##*.}" == "ipa" &&
# 2nd arg is an existing regular file
-f "$2" &&
# ...and it has an .mobileprovision extension
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@renexu
renexu / iparesign
Last active December 17, 2015 10:49
#!/usr/bin/env bash
if [[ ! ( # any of the following are not true
# 1st arg is an existing regular file
-f "$1" &&
# ...and it has a .ipa extension
"${1##*.}" == "ipa" &&
# 2nd arg is an existing regular file
-f "$2" &&
# ...and it has an .mobileprovision extension
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@tomredman
tomredman / Cocoapods-Build-Phase.md
Last active March 23, 2019 03:27
Add file to specific Pods' Frameworks Build Phase using cocoapods' post_install

In a large, nested project where I prefer to control the workspace, I run pod install --no-integrate on my root project. However, some pods don't include their required static libs correctly within their target's framework build phases.

For example, Pod-TestFlightSDK's required libTestFlight.a is excluded and removed every time I update my pods. Which required me to manually update the Pod target each time to include the static lib, which required me to automate it:

post_install do |installer_representation|
    installer_representation.project.targets.each do |target|
        if target.name == 'Pods-TestFlightSDK'
            libFile = installer_representation.project.new_file('TestFlightSDK/libTestFlight.a')
        end
@mklooss
mklooss / jpegcompress.sh
Last active September 26, 2017 07:29
optipng / jpegoptim
#!/bin/bash
# combine mozjpeg and jpegoptim
# you have to build https://github.com/mozilla/mozjpeg first
# path = /opt/mozjpeg
# ~# find . -iname "*.jp*g" -type f -exec jpegcompress "{}" \;
if [ -z "$1" ]; then
echo "is empty"
exit;
@Katafalkas
Katafalkas / gist:eb5e840df1ace981c359
Created December 12, 2014 15:03
Swift UITableViewCell custom subclass simple Chat Bubble
class Cell: UITableViewCell {
override func drawRect(rect: CGRect) {
var bubbleSpace = CGRectMake(20.0, self.bounds.origin.y, self.bounds.width - 20, self.bounds.height)
let bubblePath1 = UIBezierPath(roundedRect: bubbleSpace, byRoundingCorners: .TopLeft | .TopRight | .BottomRight, cornerRadii: CGSize(width: 20.0, height: 20.0))
let bubblePath = UIBezierPath(roundedRect: bubbleSpace, cornerRadius: 20.0)
UIColor.greenColor().setStroke()
UIColor.greenColor().setFill()
@bnickel
bnickel / RestorationDefender.swift
Last active January 12, 2023 09:47
A few friendly methods to help you detect state restoration problems in your non-storyboard apps.
// USAGE:
// Call RestorationDefender.printViewControllerClassesThatAreProbablyNotRestorable() to print a list of view controllers that will probably not return from state restoration.
// Call RestorationDefender.crashWhenViewControllersDoNotImplementStateRestoration() to crash your app when a view controller appears without setting restorationIdentifier and restorationClass.
// Call RestorationDefender.shoutWhenViewControllersDoNotImplementStateRestoration() to print a big message when a view controller appears without setting restorationIdentifier and restorationClass.
import Foundation
private func objc_getClassList() -> [AnyClass] {
let expectedClassCount = objc_getClassList(nil, 0)
var allClasses = UnsafeMutablePointer<AnyClass?>.alloc(Int(expectedClassCount))
@mamaz
mamaz / fabric.sh
Last active December 7, 2023 07:53
iOS build script for building and uploading to Fabric
#!/bin/sh
#
# Simple script for uploading binaries to Fabric (d/h Crashlytics)
#
# written by @taufik_obet
# modified for pushing to fabric by @hismamaz
#
#
@ruandao
ruandao / swizzle
Created April 22, 2015 08:14
swift method swizzle
public override class func initialize() {
struct Static {
static var token: dispatch_once_t = 0
}
if self !== RCChatListViewController.self {
return
}