Skip to content

Instantly share code, notes, and snippets.

View universal's full-sized avatar

Johannes / universa1 universal

View GitHub Profile
@universal
universal / output
Last active September 27, 2018 07:26 — forked from marzdgzmn/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)>'
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
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
@universal
universal / answer.rb
Last active October 25, 2016 09:40 — forked from anonymous/answer.rb
class Answer < ApplicationRecord
belongs_to :question
belongs_to :student
end
<%= form_for @serialized_products_form, url: serialized_products_path do |f| %>
<%= f.fields_for :serialized_products, @serialized_products_form.serialized_products do |p| %>
<%= p.label :product_id %><br>
<%= p.text_field :product_id %>
<%= p.label :location_id %><br>
<%= p.text_field :location_id %>
<%= p.label :serial %><br>
@font-face {
font-family: 'LibreBaskervilleItalic';
src: font-url('LibreBaskerville-Italic-webfont.eot');
src: font-url('LibreBaskerville-Italic-webfontd41d.eot?#iefix') format('embedded-opentype'),
font-url('LibreBaskerville-Italic-webfont.woff') format('woff'),
font-url('LibreBaskerville-Italic-webfont.ttf') format('truetype'),
font-url('LibreBaskerville-Italic-webfont.svg#LibreBaskervilleItalic') format('svg');
font-weight: normal;
font-style: normal;
## ERROR
Showing c:/Sites/postgreSQL_test/app/views/welcome/index.html.erb where line #9 raised:
undefined method `each' for nil:NilClass
Marked: <% @result.each do |element| %>
@universal
universal / travail.rb
Last active May 31, 2016 07:54
try to have a array of hash for put on jquery tre viewer...
class Travail < ActiveRecord::Base
def to_tree
Jbuilder.new do |build|
build.hash(self, :title, :id)
end
end
end
rake read_database
[DEPRECATION] `last_comment` is deprecated. Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated. Please use `last_description` instead.
rake aborted!
SyntaxError: /home/ubuntu/workspace/lib/tasks/read_database.rake:22: syntax error, unexpected tLABEL
title: data["artObject"]["title"],
^
/home/ubuntu/workspace/lib/tasks/read_database.rake:23: syntax error, unexpected tLABEL, expecting '='
description: data["artObject"]["description"],
^
class BackchannelController < ApplicationController
skip_before_action :authenticate!
before_action :authenticate_internal_api!
# POST /backchannel/event
def backchannel_event
organization_id = params[:organization_id]
report_id = params[:report_id]
execution_id = params[:execution_id]