Coder Social home page Coder Social logo

offline-gists's Introduction

offline-gists is a simple Ruby Rakefile that makes it easy to keep offline copies (i.e. backups) of gists.

Why?

  1. Paranoia -- what happens if github loses my critical gists?
  2. Offline access -- not all airplanes have wifi

Requirements

  • Ruby 1.9.2
  • Rubygems
    • bundler gem
    • git gem
    • psych gem

Getting started

Google will help you get Ruby and Rubygems installed if you don't have them already. (You can check with these commands: ruby -v and gem -v.) Then:

  1. Run bundle
  2. Clone this repository (git clone git://github.com/masnick/offline-gists.git)
  3. Rename gists/manifest_example.yaml to gists/manifest.yaml and add your gists.
  4. From the root folder of the repository, run rake. You should see your gists cloned into the gists/ subfolder.

manifest.yaml

The format is simple YAML:

---
'local name for gist': 478d9e3cd926028c91f6
'local name for another gist': 901651

You can have as many gists as you want in here.

The name for each gist is just used for naming the folder of the local repository. Spaces are converted into dashes and all non-alphanumeric characters are removed.

Multiple manifest files

You can have as many folders as you want at the same level as gists/. Each of these can have a manifest.yaml file. The rake task defaults to the gists/ folder, but you can run rake run[foo] to use the manifest file in the foo/ folder.

Sharing your manifest

This is easy! Just make your gists/ or other folder a git repository.

cd gists
git init

Then add the following to gists/.gitignore:

*
!.gitignore
!manifest.yaml

Then make your initial commit:

git add -A
git ci -am "initial commit"

Now you can push/pull this repository as you would normally. Note: if you share this repository publicly and it includes private gists, these gists will be accessible to anyone who looks at the manifest file!

Copying

All rights reserved. Feel free to use for non-commercial or personal projects. For other uses, please contact me via my website.

offline-gists's People

Contributors

masnick avatar

Stargazers

Priyadarshan avatar  avatar Stephen avatar Joe Caccavano avatar Phillip Smith avatar  avatar Rob Daly avatar  avatar Max Fenton avatar Stefaney Roberts avatar  avatar

Watchers

 avatar James Cloos avatar

Forkers

xiconet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.