TL;DR
Create a backup:
pg_dumpall > mybackup.sql
Perform the upgrade:
sudo pg_dropcluster 9.4 main --stop
Person = { | |
instance: function(name, lastname) | |
{ | |
var base = this; | |
base._private = {} | |
base._public = {} | |
base._private.name = name; | |
base._private.lastname = lastname; |
class FilePosition: | |
def __init__(self, bufferId): | |
self.bufferId = bufferId #sets the bufferId | |
self.filePositions = [] # where the modified lines will be stored | |
self.lastPos = 0 | |
self.counter = 0 | |
def addFilePosition(self, pos): | |
self._findDelete(pos) # checks if the line number is already in the list |
module TableHelpers | |
VALID_FORMATS = [:html, :text] | |
# Find a table on the page and convert it to an array of arrays. | |
# | |
# selector_or_node - A String CSS selector to find the table, or a | |
# Nokogiri::XML::Node object (if you already have a | |
# reference to the table). | |
# options - Optional hash: | |
# columns - An Integer or Range of Integers. Lets you |
" 0 preamble ============================================================== {{{ | |
" | |
" There is a great organization scheme in place here. If you run the | |
" :options command in Vim, you see a list of all the options that you | |
" can set, along with their current settings and a brief description of | |
" them. The great thing about this scheme is that--for better or | |
" worse--it sets up a system which can organize all my settings. I've | |
" decided to organize everything below thus, throwing ancillary things | |
" (my own mappings, plugin settings, and so on) where it makes sense. | |
" |
#initializers/i18n.rb | |
I18n.module_eval do | |
class << self | |
def translate_with_puts(*args) | |
Rails.logger.debug "#{args}" | |
old_translate(*args) | |
end | |
alias :old_translate :translate | |
alias :translate :translate_with_puts | |
end |
1 |
TL;DR
Create a backup:
pg_dumpall > mybackup.sql
Perform the upgrade:
sudo pg_dropcluster 9.4 main --stop
# in controller | |
# for local files | |
send_file '/path/to/file', :type => 'image/jpeg', :disposition => 'attachment' | |
# for remote files | |
require 'open-uri' | |
url = 'http://someserver.com/path/../filename.jpg' | |
data = open(url).read | |
send_data data, :disposition => 'attachment', :filename=>"photo.jpg" |
# Example from: http://snipplr.com/view/37063/ | |
include Rails.application.routes.url_helpers | |
# set host in default_url_options: | |
default_url_options[:host] = "localhost" | |
# can then use: | |
url_for() |
require "bundler/inline" | |
gemfile do | |
gem "graphql", "1.13.2" | |
gem "graphql-enterprise", "1.1.0" | |
end | |
class BaseField < GraphQL::Schema::Field | |
include GraphQL::Enterprise::Changeset::FieldIntegration | |
end |