Skip to content

Instantly share code, notes, and snippets.

@jakcharlton
jakcharlton / 01-activerecord.rb
Created March 18, 2016 02:16 — forked from janko/01-activerecord.rb
PostgreSQL JSON querying in Sequel (my presentation from our local Ruby meetup)
require "active_record"
ActiveRecord::Base.establish_connection('postgres:///testing')
ActiveRecord::Migration.verbose = false
ActiveRecord::Migration.class_eval do
create_table :played_quizzes, force: true do |t|
t.integer :player_ids, array: true
t.json :quiz_snapshot
end
anonymous
anonymous / diaspora_install.txt
Created February 15, 2012 21:51
installing diaspora vanilla / pistos @ debian stable w/postgres
#
# installing diaspora vanilla / pistos @ debian stable w/postgres
#
# please read the whole doc first before executing these
# steps. this is for people who know why a reserver proxy
# is a good idea. and how to setup one ;-)
#
# a little bit knowledge in rails/rvm/gem and how to operate
# your os-of-choice properly from commandline is preferable
@axavio
axavio / calispora-features.txt
Created January 7, 2012 21:03
Calispora Implementation of off-master Features
As of 07-Jan-2012
Implemented Features From Pistos:
comment-preview-2
view-own-profile-button
post-hint-in-notifications
federation-subscription-3
maxwell--fix-photo-feature
vcuculo--2488-fix-oembed
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;
},
anonymous
anonymous / gist:1163498
Created August 22, 2011 20:50
zero escort board
.spot {
fill: #F7EC7F;
stroke: #FBD711;
stroke-width: 2;
}
.side-1 {
color: #ED217C;
fill: #ED217C;
}
@Pistos
Pistos / diakonos-256-colour-light-bg.conf
Created February 23, 2011 01:43
Baseline config for light background colour scheme for Diakonos
colour 32 253 39 # selection; light grey on light blue
colour 33 69 255 # comments; blue on white
colour 34 45 black # Ruby symbols; light blue on black
colour 35 123 black # Ruby instance variables; light blue on black
colour 36 177 54 # regular expressions; purple on dark purple
colour 37 111 17 # single-quoted strings; light blue on dark blue
colour 38 117 18 # double-quoted strings; light blue on dark blue
colour 39 213 90 # shell-quoted strings; light purple on purple
colour 40 15 234 # constants; white on light black
colour 44 224 88 # Ruby modifiers; light red on dark red
Uncaught exception: TypeError: Cannot convert 'a.runtimeStyle' to object
Error thrown at line 130, column 0 in <anonymous function: aa>(a, b) in https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js:
e=a.runtimeStyle.left;
called from line 127, column 838 in <anonymous function: get>(d, e, f) in https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js:
h=aa(d,b,b);
called from line 127, column 35 in <anonymous function: css>(a, b, d) in https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js:
if(h&&"get"in h&&(e=h.get(a,true,d))!==B)
called from line 167, column 117 in <anonymous function>(e) in https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js:
f=c.css(f,d);
class Etanni
SEPARATOR = "E69t116A65n110N78i105S83e101P80a97R82a97T84o111R82"
CHOMP = "<<#{SEPARATOR}.chomp!"
START = "\n_out_ << #{CHOMP}\n"
STOP = "\n#{SEPARATOR}\n"
REPLACEMENT = "#{STOP}\\1#{START}"
def initialize(template, filename = '<Etanni>')
@template = template
@filename = filename

An introduction to rvm_sandboxed

So, under the hook, rvm uses a variety of environment variables to tell it where to locate things. Out of the box, these variables are current:

  • rvm_path - the directory in which rvm is installed (e.g. typically ~/.rvm)
  • rvm_prefix - basically, ${rvm_prefix}rvm is used to build the default rvm_path. It tells rvm how to build the default rvm_path, rvm_bin_path and rvm_man_path. This also relies on the rvm_sandboxed argument
  • rvm_sandboxed - tells rvm how to behave when working with rvm_prefix. See "How does rvm_sandboxed work?" below for more information.
@Pistos
Pistos / rvm-ruby.sh
Created May 2, 2010 23:36
A little wrapper script to run RVM-based Ruby interpreters from cron
#!/bin/bash
if [[ -z ${2} ]]; then
echo "$0 <ruby interpreter|'default'> <arguments to ruby interpreter>"
exit 1
fi
if [[ -s /opt/rvm/scripts/rvm ]] ; then source /opt/rvm/scripts/rvm ; fi
rvm use "${1}"