Social Snippet

Share and use the snippet libraries for the online judges.

[ Google Code Jam, Codeforces, Aizu Online Judge and etc... ]

1. Quick Start for the busy person

How to install social snippet

You can install the social-snippet core system by typing the command as follow:

$ gem install social_snippet

...then, you should install the editor plugin (e.g. social_snippet.vim).

Requirements

(We recommend to use the latest versions of Ruby and Git)

Installation Demo (with social_snippet.vim)


2. How it works

The Command-line Interface

The social_snippet gem provides the command-line interface to manage and use the snippet libraries. For example, you can search the libraries by running $ sspm search {keyword} command, and install them by running $ sspm install {name} command. The sspm-install command can resolve dependencies between the libraries, so if the system found a missing required library on the installation of some library, it is also installed to the your system automatically.

@snip / @snippet annotation tags

To insert snippet texts, the social-snippet's core system replaces the annotated comment lines with the code specified on the comments.

Basic Syntax

(1) Before insert a snippet

// @snip < {repo-name} # {repo-version} : {file-path} >

(2) After insert a snippet

// @snippet < {repo-name} # {repo-version} : {file-path} >
{the snippet source code}

Description

{repo-name}
This is the name of repository added in the social-snippet registry system. You can install the repository by running $ sspm install {repo-name} command.

Example Code Before and after inserting snippets


3. Applications and Web Services

The social-snippet core system

https://rubygems.org/gems/social_snippet

The social-snippet registry system

https://sspm.herokuapp.com

social_snippet.vim

https://github.com/social-snippet/vim-social-snippet

Application Demo (with social_snippet.vim)