Skip to content

Instantly share code, notes, and snippets.

@antongaenko
antongaenko / convert_imports.rb
Created June 26, 2017 11:06 — forked from smileyborg/convert_imports.rb
A script to convert textual imports to framework imports. Useful when converting static libraries to dynamic frameworks.
#!/usr/bin/env ruby
require 'set'
UMBRELLA_HEADER_PATH = ARGV[0] # The path to the umbrella header containing all the headers
SOURCE_ROOT_PATH = ARGV[1] # The path containing the source files to convert (will be recursively searched)
FRAMEWORK_NAME = File.basename(UMBRELLA_HEADER_PATH, ".*") # Assumes that the framework name is the same as the umbrella header filename (e.g. "MyFramework" for "MyFramework.h")
UMBRELLA_IMPORT_REGEX = /#import\s+<#{FRAMEWORK_NAME}\/.+\.h>/ # Matches "#import <FrameworkName/Header.h>"
FRAMEWORK_HEADER_REGEX = /(?<=<#{FRAMEWORK_NAME}\/).+\.h(?=>)/ # Matches "Header.h" in "<FrameworkName/Header.h>"
@antongaenko
antongaenko / gist:ead3d615160df43b108bf62ac2467245
Created November 22, 2019 18:23 — forked from steipete/ios-xcode-device-support.sh
Using iOS 13.2 devices with Xcode 11.1 (instead of Xcode 11.2) (also, Xcode 10.3)
// The trick is to link the DeviceSupport folder from the beta to the stable version.
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
// Support iOS 13.2 devices (Xcode 11.2) with Xcode 11.1:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.2 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
// Xcode 10.3 to Xcode 11
sudo ln -s /Applications/Xcode-11.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0 /Applications/Xcode-10.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
// Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
@antongaenko
antongaenko / how_to_connect.md
Created February 16, 2020 17:01 — forked from super-dog-human/how_to_connect.md
How to connect Oculus Go controller(OMVR-V190) to macOS 10.12
  1. Prepare a Mac supports BLE
  2. Download the Additional Tools for Xcode from Apple Developer
  3. Open the Bluetooth Explorer
  4. Press and hold the Oculus button and back button of controller until the controller LED blinks
  5. Select menu [Devices] -> [Low Energy Devices]
  6. Click [Start Scanning] button.
  7. Chose OMVR-V190 in Device and click [Connect] button.
@antongaenko
antongaenko / Storing-Images-On-Github.md
Created January 22, 2021 17:28 — forked from joncardasis/Storing-Images-On-Github.md
Storing Images and Demos in your Repo

Storing Images and Demos in your Repo

In this quick walkthough you'll learn how to create a separate branch in your repo to house your screenshots and demo gifs for use in your master's readme.

How to

1. Clone a fresh copy of your repo

In order to prevent any loss of work it is best to clone the repo in a separate location to complete this task.

2. Create a new branch

Create a new branch in your repo by using git checkout --orphan assets

@antongaenko
antongaenko / .bash_profile
Created June 30, 2022 10:26
My bash and git aliases
# git
alias gs='clear | git status -u'
alias gl="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
alias glon="git log --pretty=oneline"
alias gph='git push'
alias gpo='git push --set-upstream origin'
alias gpt='git format-patch'
#git format-patch cc1dde0dd^..6de6d4b06 --stdout > foo.patch