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
@a13xb
a13xb / Podfile
Created January 11, 2016 12:21
Quick workaround for per-target asset catalog compilation using a Podfile post_install hook
# ...
# Workaround for https://github.com/CocoaPods/CocoaPods/issues/1546
post_install do |installer|
installer.aggregate_targets.each do |at|
files = at.user_targets.map{|t|
t.resources_build_phase.files_references.select{|f|
f.last_known_file_type == 'folder.assetcatalog'
}.map{|f|
Pathname.new(f.real_path).relative_path_from(f.project.path.dirname)

KVM OSX Guest 10.11 (El Capitan) with Clover

  • Some notes about this approach:
    • An OSX Installer USB drive for Install OS X El Capitan is created
    • Clover is then installed on the USB drive
    • Clover Configurator is then run on the USB drive
    • The USB drive contents are copied to the VM host
    • VNC is used to connect to the guest UI
  • The qxl virtual video device is used (part of the standard kvm qemu install)
@jasdev
jasdev / CustomCell.swift
Last active July 6, 2018 17:29
An approach to safer UITableViewCell and UICollectionViewCell reuse
class CustomCell: UITableViewCell, Reusable {
class var reuseIdentifier: String {
return "customCell"
}
}
class SupaHotCustomCell: CustomCell {
override class var reuseIdentifier: String {
return "supaHotCustomCell"
}
@vparihar01
vparihar01 / README.md
Last active November 11, 2016 15:09
Swift 2 + IOS >8.4 tips, tricks and code snippets for various UI's and functionality.

Swift 2 + IOS 8.4 & above Code Samples, tips, tricks for various UI customization

  • [UIViewExtension] - UIView extension for adding view border , corner radius , border color, border width and setting custom border like left,right,top and bottom borders from Storyboard.
  • [UILabelCustomize] - Add the shadow to UILabel. Customize the uilabel, to add the border with color, make it round and translate the inner text to right by X.
  • [UIColorHexToColor] - Convert the hex color into ios colors.
  • [UIbuttonExtension] - Text padding/inset from left to UIButton.
  • [buttonBorder] - IOS Add top , bottom, left and right button to button/text field.
  • [buttonPadding] - Add little text padding/inset from left
  • [StringExtension] - Truncate String in Swift
@lukas1994
lukas1994 / migrator.js
Created August 26, 2015 22:50
migrate localeIdentifier field in Parse _Installation to new format
Parse.Cloud.job("localeIdentifierMigration", function(request, status) {
var modify = function(old) {
return old.replace(/_/g, "-").split("@")[0];
};
Parse.Cloud.useMasterKey();
var query = new Parse.Query("_Installation");
query.each(function(installation) {
var old = installation.get("localeIdentifier");
if (old) {
@hsavit1
hsavit1 / Ass.swift
Created August 13, 2015 17:16
Associated Objects and Method Swizzling in Swift
extension UIViewController {
private struct AssociatedKeys {
static var DescriptiveName = "nsh_DescriptiveName"
}
var descriptiveName: String? {
get {
return objc_getAssociatedObject(self, &AssociatedKeys.DescriptiveName) as? String
}
set {
@patik
patik / how-to-squash-commits-in-git.md
Last active May 30, 2024 07:59
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@githubutilities
githubutilities / Apple-real-device-debugging.md
Last active November 18, 2023 12:41
install ipa using command line

Apple Real Devices Debugging

What you need

  • certificate--which tells your devices that Apple trust you
  • a app id
  • a test device
  • a provisioning profile
@mxpr
mxpr / 0.1-export-plist.sh
Last active November 25, 2022 04:15
Export Options Plist flag in xcodebuild
# Switch xcrun to leverage Xcode 7
# Note: This won't be needed once Xcode 7 is released
# and becomes the primary Xcode in use.
export DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer/
# Export Archive
xcrun xcodebuild -exportArchive -exportOptionsPlist exportPlist.plist -archivePath /path/to/app.xcarchive -exportPath /path/to/app.ipa