Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hugo53/icodesnippets
Sync Xcode Code Snippets, from home Mac to office Mac and vice versa.
https://github.com/hugo53/icodesnippets
Last synced: 9 days ago
JSON representation
Sync Xcode Code Snippets, from home Mac to office Mac and vice versa.
- Host: GitHub
- URL: https://github.com/hugo53/icodesnippets
- Owner: hugo53
- Created: 2013-12-25T10:56:45.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-05T16:24:47.000Z (almost 11 years ago)
- Last Synced: 2023-03-22T15:28:07.105Z (over 1 year ago)
- Homepage:
- Size: 148 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iCodeSnippets
_Easy to do trivial things._
Don't waste your time on trivial code even it is easy to write. We focus on making awesome products, right?
If you have some blocks of code, and if they are not private, it is better if you share them to other peers. Now waiting for what? Let's contribute! All of you are welcome warmly!## How to install?
Xcode provides an area to save snippet code for later using. Press ```Control + Option + Command + 2``` to show
Code Snippet Library (right-lower corner).Xcode saves its snippets code at location:
```bash
~/Library/Developer/Xcode/UserData/CodeSnippets/
```
or
```bash
/Users/username/Library/Developer/Xcode/UserData/CodeSnippets
```Therefore, we will make a git repo which also locate at that location. Do that, we can make snippets to be updated just by pulling/pushing git repo.
So, there are two ways to make your snippet go visible on git repository.
##### Method 1
```
cd ~/Library/Developer/Xcode/UserData/CodeSnippets/
git init
git remote set-url origin https://[email protected]/username/iCodeSnippets.git// Next, pull or push, it is up to you. Recommend that PULL first if your repo is not up-to-date.
```##### Method 2
```
cd ~/Library/Developer/Xcode/UserData/
cp CodeSnippets CodeSnippetsBackup // Backup CodeSnippets folder if it is existing
rm -r CodeSnippets // Remove CodeSnippets folder
git clone https://[email protected]/username/iCodeSnippets.git CodeSnippets
cp CodeSnippetsBackup/* CodeSnippets/ // Optional, if you want to merge the exisiting snippets and snippets from repo// Next, PUSH or PULL, it is up to you. Recommend that PUSH first if your repo is merged!
```## TroubleShooting
Error:
```bash
error: The requested URL returned error: 403 while accessing https://github.com/hugo53/iCodeSnippets.git/info/refs?service=git-receive-pack
fatal: HTTP request failed
```Fix:
```
git remote set-url origin https://[email protected]/username/iCodeSnippets.git
```May need to change ownership of the Snippets folder and its subfolders
```
chmod -R 777 CodeSnippets/
```> **Warning: Besure that your code is WILLING to go PUBLIC if you use public git repository!!!**
> Next task: Synchronize Bookmark Documentation.
> Bookmark is saved in ```~/Library/Preferences/com.apple.dt.Xcode.plist``` with key ```Xcode.Organizer.Documentation.Bookmarks```. Just parse this key and get all items.