Skip to content

Instantly share code, notes, and snippets.

class ShareAnything < ActiveRecord::Migration
def self.up
# remove indices and keys of post_id column, since we want to rename it
remove_foreign_key :aspect_visibilities, :posts
remove_index :aspect_visibilities, :post_id_and_aspect_id
remove_index :aspect_visibilities, :post_id
# rename post_id column to shareable_id since now everything can have
# a aspect_visibility not only posts
# store the table that the thing we reference in shareable_id in shareable_type
class MovePhotosToTheirOwnTable < ActiveRecord::Migration
def self.up
create_table "photos", :force => true do |t|
t.integer "tmp_old_id", :null => true
t.integer "author_id", :null => false
t.boolean "public", :default => false, :null => false
t.string "diaspora_handle"
t.string "guid", :null => false
t.boolean "pending", :default => false, :null => false
t.text "text"
diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js
index baf4e0d..a63f58c 100644
--- a/public/javascripts/publisher.js
+++ b/public/javascripts/publisher.js
@@ -362,8 +362,11 @@ var Publisher = {
return false;
}
Publisher.hidePreview();
+ Publisher._pendingSubmit = true;
},
/var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/spec_set.rb:88:in `materialize': Could not find client_side_validations-3.1.0 in any of the sources (Bundler::GemNotFound)
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/spec_set.rb:82:in `map!'
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/spec_set.rb:82:in `materialize'
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:90:in `specs'
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:135:in `specs_for'
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:124:in `requested_specs'
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/environment.rb:23:in `requested_specs'
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:11:in `setup'
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'
from /var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/setup.rb:17
@manuels
manuels / gist:1320677
Created October 27, 2011 19:53
oEmbed iframe check script
require 'rubygems'
require 'oembed'
urls =<<URLS
http://www.youtube.com/watch?v=2BYXBC8WQ5k
http://qik.com/video/49565
http://revision3.com/tekzilla/cali-lewis-onstar-review
http://www.hulu.com/watch/293814/the-morning-after-thu-oct-27-2011?promo=thumbnail
http://www.viddler.com/explore/cdevroe/videos/424/
URLS
require 'erb'
module Diaspora
module Markdownify
class HTML < Redcarpet::Render::HTML
include ActionView::Helpers::TextHelper
include ActionView::Helpers::TagHelper
def initialize(options={})
@options = options
Dear Diasporians,
We are sorry that you are currently encountering a lot of errors on JoinDiaspora.com which are caused by overstrain of our hardware resources.
Due to a tragic loss in our developer community we have limited options to solve this issue and ask for your patience concerning the availability of our service.
We appreciate your understanding and thank all of you for your condolences!
The Diaspora Podrunners and Developers
@manuels
manuels / gist:1712984
Created January 31, 2012 21:21
Running Hem with Haml and Eco
var hem = new (require('hem'));
var haml = require('haml');
var eco = require('eco');
var fs = require('fs');
var argv = process.argv.slice(2);
hem.compilers.haml = function(path) {
var content = fs.readFileSync(path, 'utf8')
var template;
template = haml(content)()
<html>
<style>
/*! normalize.css v1.0.0 | MIT License | git.io/normalize */
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em;margin:.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.75em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:1em 40px}dfn{font-style:italic}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/wily64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'ubuntu/wily64'
default: URL: https://atlas.hashicorp.com/ubuntu/wily64
==> default: Adding box 'ubuntu/wily64' (v20160715.0.0) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/ubuntu/boxes/wily64/versions/20160715.0.0/providers/virtualbox.box
==> default: Successfully added box 'ubuntu/wily64' (v20160715.0.0) for 'virtualbox'!
==> default: Importing base box 'ubuntu/wily64'...