Skip to content

Instantly share code, notes, and snippets.

Johannes / universa1 universal

Block or report user

Report or block universal

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 output
1) MirrorSync#execute_custom_script when the custom script succesfully runs should not raise any errors
Failure/Error: expect { mirror_sync.execute_custom_script('false') }.to_not raise_error
expected no Exception, got #<NameError: undefined local variable or method `e' for #<MirrorSync:0x00005601c08bce60>> with backtrace:
# ./spec/models/mirror_sync_spec.rb:9:in `execute_custom_script'
# ./spec/models/mirror_sync_spec.rb:20:in `block (5 levels) in <top (required)>'
# ./spec/models/mirror_sync_spec.rb:20:in `block (4 levels) in <top (required)>'
View console.txt
ruby test.rb 'puts "42"'
evaluating next: puts "42"
{:result=>nil, :output=>"42\n"}
ruby test.rb '1+1'
evaluating next: 1+1
{:result=>2, :output=>""}
View application.rb
require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module ArkMonitor
class Application < Rails::Application
View timer.rb
finished = true
timer = EM::PeriodicTimer.new(5) do
if finished
finished = false
method = http.post :body => { data: { serial_no: serial } }
method.errback { $stderr.puts 'Can\'t connect to cloud'; finished = true }
method.callback do
finished = true
p method.response_header.status
p method.response_header
View nginx-rails-ssl.vhost
upstream dummy.us {
server unix:/home/dummyus/deploy/dummyus/tmp/puma.sock;
}
server {
listen 255.255.255.256:80;
listen [1111:1111:1111:1111::256]:80;
server_name dummy.us www.dummy.us;
View dummy.txt
form
input: name
nav-navtabs
cow | dog | cat
nav-content
cow
fields_for :cow
...
dog
fields_for :dog
View bug_after_restarting_twice_and_save.bib
% Encoding: windows-1252
@Comment{jabref-meta: databaseType:bibtex;}
@Comment{jabref-meta: saveOrderConfig:specified;bibtexkey;false;author;false;title;false;}
@Comment{jabref-meta: selector_journal:Agrarwirtschaft;Computational Statistics \\\\\\\\& Data Analysis;Jahrb{\\\\\\\\"u}cher f{\\\\\\\\"u}r National{\\\\\\\\"o}konomie und Statistik;}
View book.rb
class Book < ApplicationRecord
has_and_belongs_to_many :categories
validates :categories, presence: true
end
View gist:28f237f72b58dbc02de12ff4864dfda5
http://catalog.update.microsoft.com/v7/site/ScopedViewRedirect.aspx?updateid=87a7756f-1451-45da-ba8a-55f8aa29dfee
$ cabextract 20662520_6c535fbfa9dca0d07ab069e8918896086e2af0a7.cab
$ hex2hcd BCM20702A1_001.002.014.1443.1572.hex
# cp BCM20702A1_001.002.014.1443.1572.hcd /lib/firmware/brcm/BCM20702A1-0a5c-216f.hcd
# may not be necessary
# ln -rs /lib/firmware/brcm/BCM20702A1-0a5c-216f.hcd /lib/firmware/brcm/BCM20702A0-0a5c-216f.hcd
View streaming_csv_controller.rb
class StreamingCsvController < ApplicationController
def test
respond_to do |format|
format.csv {render_csv}
end
end
private
def render_csv
set_file_headers
You can’t perform that action at this time.