Skip to content

Instantly share code, notes, and snippets.

Wellington Torrejais da Silva wellington1993

Block or report user

Report or block wellington1993

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ruby-versions-rails-Compatibility.txt
55
I have an old 2.1.1 Ruby on Rails application, with the system upgraded to use Ruby 1.8.7. It originally used 1.8.5 or so.
I want to upgrade it to Ruby 1.9.x for performance reasons, and possibly to a newer Ruby on Rails as well.
I cannot find any easy chart of compatibility between different Ruby versions and Ruby on Rails versions.
Will 2.1.1 work with Ruby 1.9.x? If not, how far do I need to upgrade it first, and what kind of issues am I likely to encounter? My application does complicated things to database layer, but the rest is fairly straightforward.
ruby-on-rails ruby
View My-Lubuntu-Update-2019-Snap.sh
sudo apt autoremove -y; sudo apt update; sudo apt upgrade -y; sudo apt dist-upgrade -y; sudo snap refresh ; sudo apt autoremove -y; sudo apt full-upgrade -y ; for s in $(snap list |cut -d' ' -f1|sort -u);do sudo snap refresh --edge $s ; done
@wellington1993
wellington1993 / kinto-http-client.js
Created Jul 16, 2019
resource://services-common/kinto-http-client.js
View kinto-http-client.js
/*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
View PageStyleChild.jsm
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var EXPORTED_SYMBOLS = ["PageStyleChild"];
const { ActorChild } = ChromeUtils.import(
"resource://gre/modules/ActorChild.jsm"
@wellington1993
wellington1993 / Browser-Console-Slowdown-with-Google-Docs.js
Last active Jul 11, 2019
Browser Console Slowdown with Google Docs
View Browser-Console-Slowdown-with-Google-Docs.js
A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.
Script: resource://devtools/client/web…onents/Output/ConsoleOutput.js:188
View Error-Sync-502-Firefox.js
1562867731588 Sync.Engine.Extension-Storage ERROR Syncing side-view@mozilla.org: request failed: Error: Response from server unparseable (HTTP 502; SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data):
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>502 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>
View get-ruby-https-head.rb
# https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/Net/HTTP.html
# http://www.rubyinside.com/nethttp-cheat-sheet-2940.html
# require 'openssl'
# require 'net/http'
# require 'net/https'
# OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
url = 'https://www.google.com/'
uri = URI(url)
@wellington1993
wellington1993 / nil_empty_blank_present_ffdierence_in_ruby Difference between nil?, empty?, blank? and present? in Ruby and Ruby on Rasils.
View nil_empty_blank_present_ffdierence_in_ruby
# nil? can be used on any Ruby object. It returns true only if the object is nil.
nil.nil? # => true
[].nil? # => false
{}.nil? # => false
"".nil? # => false
" ".nil? # => false
true.nil? # => false
# empty? can be used on some Ruby objects including Arrays, Hashes and Strings. It returns true only if the object's length is zero.
nil.empty? # NoMethodError: undefined method `empty?' for nil:NilClass
View Svc-Obs-is-undefined-firefox.rs
1562248321556 FirefoxAccounts TRACE finished write of user data to the login manager
Extension error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowUtils.removeSheetUsingURIString]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://gre/modules/ExtensionCommon.jsm :: runSafeSyncWithoutClone :: line 65" data: no] undefined 65
[[Exception stack
runSafeSyncWithoutClone@resource://gre/modules/ExtensionCommon.jsm:65:12
cleanup@resource://gre/modules/ExtensionContent.jsm:353:11
close@resource://gre/modules/ExtensionContent.jsm:814:14
inner-window-destroyed@resource://gre/modules/ExtensionContent.jsm:889:19
observe@resource://gre/modules/ExtensionContent.jsm:905:27
Current stack
runSafeSyncWithoutClone@resource://gre/modules/ExtensionCommon.jsm:67:129
View gems-rails5-project-example.yaml
*** LOCAL GEMS ***
actioncable (5.2.3, 5.2.1, 5.1.7, 5.1.6.1)
actionmailer (5.2.3, 5.2.1, 5.1.7, 5.1.6.1)
actionpack (5.2.3, 5.2.1, 5.1.7, 5.1.6.1)
actionview (5.2.3, 5.2.1, 5.1.7, 5.1.6.1)
active_model_serializers (0.10.9)
activejob (5.2.3, 5.2.1, 5.1.7, 5.1.6.1)
activemodel (5.2.3, 5.2.1, 5.1.7, 5.1.6.1)
activerecord (5.2.3, 5.2.1, 5.1.7, 5.1.6.1)
You can’t perform that action at this time.