Skip to content

Instantly share code, notes, and snippets.

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@sgeorgi
sgeorgi / Faye.md
Last active June 28, 2022 16:09
Generating events as Resque/Redis.jobs and publishing them to a faye websocket on the client. This is untested, but copied off a working project's implementation

Pushing data from Server to the Client using Faye, a Resque-Job and some JS

EDIT: Forgot to mention that you need Faye's JS in your client, so just add

<%= javascript_include_tag :defaults, "http://localhost:3000/stream.js" %>

to your application.html.erb!

  1. Start server (and resque-worker) with rails s thin (and rake resque-work).
  2. Go to the index page of your Controller
@rsvalerio
rsvalerio / couchapp.conf.js
Last active October 12, 2015 10:48
node couchapp config file
'use strict';
var couchapp = require('couchapp'),
path = require('path'),
ddoc = {
_id: '_design/app',
views: {},
lists: {},
shows: {},
fulltext: {},

Proposal for Improving Mass Assignment

For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.

Sign Allowed Fields

When creating a form with form_for, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.

To allow new known fields to be added via JS, we could add:

@nicalpi
nicalpi / devise.rb
Created October 13, 2011 11:04
Omniauth multiple facebook login strategy
# initializers/devise.rb
config.omniauth :facebook, [APP_ID], [APP_SECRET]
config.omniauth :facebook_app1, [APP_ID], [APP_SECRET], :iframe => true, :scope => 'publish_stream,offline_access,email'
config.omniauth :facebook_app2, [APP_ID], [APP_SECRET], :iframe => true, :scope => 'publish_stream,offline_access,email'
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]