An Xcode Plugin to upload code snippets directly into Slack and Gist

Overview

XCSnippetr

Alcatraz compatible License

Share code snippets to Slack and Gist without leaving Xcode ever again! 😱

Features

  • Upload code snippets using Slack's and Github's APIs.
  • The plugin is available from the code editor's contextual menu.
  • Extremely easy to sign-in using your API tokens. Your tokens are secure 🙈 , stored in the system's Keychain.
  • Add an initial comment (optional).
  • Code syntax highlight, thanks to ACEView.
  • Auto-detection of the source file name, used as the snippet title by default.
  • Auto-detection of the source code type. No Swift support for now 😔 .
  • After upload, copies snippet's url to pasteboard.

Slack only:

  • Share to any of your teams, channels, groups and users.
  • Upload as a file snippet or as a message with fenced code block.
  • Upload as a private file or private message to Slackbot.
  • Team's channels are cached during your Xcode session.
  • Add as many teams as you want.

Gist only:

  • Upload private gists

How to use

Select any code snippet you would like to share and right click on it.

contextual menu

The first time, you will be prompt to authenticate.

For Slack, use your API tokens available at https://api.slack.com/web login view

For Gist, generate API tokens at https://github.com/settings/tokens/ login view

You should be ready to go now. Simply pick the team and channel to share to. Add a comment. Share! 💥 main view

Install

Install through Alcatraz, the package manager for Xcode.

Alternatively, clone the repo:

  1. Build the project to install the plugin. The plugin will be installed in ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XCSwiftr.xcplugin.

  2. Restart Xcode so the plugin bundle is loaded.

License

(The MIT License)

Copyright (c) 2016 Ignacio Romero Zurbuchen [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Plugin still doesn't install via Alcatraz

    Plugin still doesn't install via Alcatraz

    After I refactored the project to follow @Hs-Yeah recommendation in https://github.com/dzenbot/XCSnippetr/pull/7 I was expecting that Alcatraz would build the project properly, but it doesn't. The Install button stays at 3/4 and doesn't really compile the project, it just clones it.

    I followed @markohlebar's approach from Peckham I might be missing something. @markohlebar would mind giving us a hand pls?

    bug help wanted 
    opened by dzenbot 9
  • Can't build XSnippetr app

    Can't build XSnippetr app

    Do you happen to resolve such issue?

    /Users/pronebird/Downloads/XCSnippetr/XCSnippetr/Class/API/BaseAPI/XCSSnippet.h:11:9: 'ACEView/ACEModes.h' file not found
    

    Autocompletion points that this file exists but linker fails to find it.

    XC plugin builds fine.

    bug enhancement 
    opened by pronebird 9
  • Adds toast support. Closes #6 and closes #13

    Adds toast support. Closes #6 and closes #13

    Thanks a lot for this @pronebird! It looks so native to XCode with this now. This detail makes the feature complete 😆

    I've created my own icon, I hope you like it. image

    Also refactored a bit the AlertBezel code, and minor tweaks. Please have a look and let me know what you think.

    opened by dzenbot 2
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 1
  • Add support for toast

    Add support for toast

    Hi,

    I played around with the so-called toast that we discussed before and turns out its name is bezel alert panel :)

    screenshot 2015-08-06 00 58 19

    I have implemented a simple protocol for DVTBezelAlertPanel and show this kind of alert each time we copy link to pasteboard.

    https://github.com/pronebird/XCSnippetr/tree/bezel-alert

    Feel free to play around and we can potentially merge it later. :+1:

    p.s. the picture is from Xcode assets.

    opened by pronebird 1
  • Project Refactor

    Project Refactor

    This PR refactors many parts of this project to allow Alcatraz compatibility:

    • No more usage of Cocoapods for dependencies management
    • Both, the plugin and app targets share the same code
    • The backend layer is bundled in a dynamic framework, as a dependency too.
    • Third party dependencies are harcoded in the project directory (sucks for inheriting bug fixes)

    This should fix #9

    opened by dzenbot 0
  • Build fixes

    Build fixes

    This will hopefully fix Alcatraz compatibility. At least now, the builder project builds locally every time. It seems that having the same name for both, the project and target, wasn't making xcodebuild to work properly? ¯\ _(ツ) _/¯

    opened by dzenbot 0
  • Crash on ⌘+TAB

    Crash on ⌘+TAB

    The plugin crashes after submission if I start switching windows with ⌘+TAB.

    I just switched to v1.0 tag because I was sure it's my code that does that funky stuff and it does still crash.

    git --reset hard && git clean -d -x -f && pod update was ran to make sure no trash left.

    Can you confirm you experience the same issue?

    Crashed thread:

    Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes:       EXC_I386_GPFLT
    
    Application Specific Information:
    ProductBuildVersion: 6E35b
    
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   com.apple.AppKit                0x00007fff90364ecf -[NSWindow(NSWindow_Theme) acquireMainAppearance] + 28
    1   com.apple.AppKit                0x00007fff90364e2f -[NSWindow becomeMainWindow] + 39
    2   com.apple.AppKit                0x00007fff90364f2f -[NSWindow(NSWindow_Theme) acquireMainAppearance] + 124
    3   com.apple.AppKit                0x00007fff90364e2f -[NSWindow becomeMainWindow] + 39
    4   com.apple.dt.IDEKit             0x000000010fd4e516 -[IDEWorkspaceWindow becomeMainWindow] + 47
    5   com.apple.AppKit                0x00007fff90573cbb _NXShowKeyAndMain + 171
    6   com.apple.AppKit                0x00007fff9038d901 -[NSApplication sendEvent:] + 8375
    7   com.apple.dt.IDEKit             0x000000010fcfd064 -[IDEApplication sendEvent:] + 924
    8   com.apple.AppKit                0x00007fff902b5b68 -[NSApplication run] + 711
    9   com.apple.AppKit                0x00007fff90232244 NSApplicationMain + 1832
    10  libdyld.dylib                   0x00007fff8ad215c9 start + 1
    

    I never did anything for OS X, do you need to clean up the window somehow or you can simply release it? That is something from the top of my head..

    opened by pronebird 0
  • Better Alcatraz support. Closes #4 and closes #5

    Better Alcatraz support. Closes #4 and closes #5

    Creates a builder project with a simple script to import the xcworkspace, to be able to run cocoapods dependency when installing with Alcatraz.

    Based on Pekcham Plugin's approach. Thanks @Hs-Yeah !

    opened by dzenbot 0
  • Save snippets in XCode

    Save snippets in XCode

    It would be really useful to also be able to save code snippets into the built-in snippet browser of XCode. There must be some private APIs to be able to achieve this easily 🙏

    feature request 
    opened by dzenbot 7
Owner
Ignacio Romero Zurbuchen
iOS Dev. Designer. Sometimes I contribute to open source.
Ignacio Romero Zurbuchen
Some helpful swift code snippets

HelpfulSwiftSnippets Some helpful swift code snippets Network Manager - a generic network manager that deals with downloading data from the internet u

null 2 Oct 17, 2021
LinkedLog is a Xcode plugin that includes a Xcode PCH header file template that adds the macros `LLog` and `LLogF` and parses their output to link from the console to the corresponding file and line.

LinkedLog Xcode Plugin LinkedLog is a Xcode plugin that includes a Xcode PCH file template that adds the macros LLog and LLogF. The LLog macro will wo

Julian F. Weinert 22 Nov 14, 2022
Xcode Plugin helps you find missing methods in your class header, protocols, and super class, also makes fast inserting.

FastStub-Xcode Life is short, why waste it on meaningless typing? What is it? A code generating feature borrowed from Android Studio. FastStub automat

mrpeak 509 Jun 29, 2022
SwiftLint Plugin for Xcode.

SwiftLint Xcode Plugin Demo Usage Set SwiftLint Path default: Default path is /usr/local/bin/swiftlint relative: Relative path with the current projec

null 18 Jul 23, 2022
The awesome Fastlane tools brought into your Xcode

Fastlane-Plugin for Xcode Features Run fastlane command with one click. Add your Fastfile in xcode. Setup Fastlane. Install Install via Alcatraz OR Cl

Rishabh Tayal 38 Jun 6, 2021
SyntaxTree - This code attempts to make basic syntax trees in the Xcode console

SyntaxTree This code attempts to make basic syntax trees in the Xcode console. I

Yash 0 Feb 12, 2022
Capacitor File Opener. The plugin is able to open a file given the mimeType and the file uri

Capacitor File Opener. The plugin is able to open a file given the mimeType and the file uri. This plugin is similar to cordova-plugin-file-opener2 without installation support.

Capacitor Community 32 Dec 21, 2022
PhoneGap / Cordova Social Sharing plugin

PhoneGap / Cordova Social Sharing plugin Every now and then kind folks ask me how they can give me all their money. So if you want to contribute to my

null 0 Oct 21, 2021
A apple search ads attribution plugin for flutter

A apple search ads attribution plugin for flutter

liam 0 Oct 27, 2021
Cordova iOS plugin for Fingerprint SDK.

FingerprintPlugin This is a cordova plugin for Fingerprint SDK. Installation Add Cordova plugin to your project: To add a Cordova plugin to your proje

Khawar Shahzad 0 Nov 19, 2021
A plugin to allow Lightroom to export HEIC files

LRExportHEIC A plugin to allow Lightroom to export HEIC files. There are two components: The plugin itself, which is the component that interfaces wit

Manu Wallner 21 Jan 3, 2023
FlutterNativeDragAndDrop - A package that allows you to add native drag and drop support into your flutter app

native_drag_n_drop A package that allows you to add native drag and drop support

Alex Rabin 21 Dec 21, 2022
Save development time! Respresso automatically transforms and delivers your digital assets into your projects

Introduction Respresso is a centralized resource manager for shared Android, iOS and Web frontend projects. It allows you to simply import the latest

Respresso 10 Nov 8, 2022
Save development time! Respresso automatically transforms and delivers your digital assets into your projects

Respresso Android client Respresso is a centralized resource manager for shared Android, iOS and Web frontend projects. It allows you to simply import

Respresso 11 May 27, 2021
Save development time! Respresso automatically transforms and delivers your digital assets into your projects

Respresso iOS client Respresso is a centralized resource manager for shared Android, iOS and Web frontend projects. It allows you to simply import the

Respresso 50 May 1, 2021
Beak 🐦 Peck into your Swift files from the command line

Beak ?? Peck into your Swift files from the command line Beak can take a standard Swift file and then list and run any public global functions in it v

Yonas Kolb 566 Dec 6, 2022
Turn your Swift data model into a working CRUD app.

Model2App is a simple library that lets you quickly generate a CRUD iOS app based on just a data model defined in Swift. (CRUD - Create Read Update De

Q Mobile 132 Dec 22, 2022
Condense string literals into global variables.

Gettysburg This is an implementation of the SAX interface. API Documentation Documentation of the API can be found here: Gettysburg API A note on Char

Galen Rhodes 0 Nov 12, 2021
Codeless Appodeal integration into Unity project.

Codeless out of the box Appodeal integration into Unity project. Contains global config file which provide you ability to setup Appodeal without any line of code.

Ivan Murzak 1 Dec 30, 2021