Skip to content

Instantly share code, notes, and snippets.

View universal's full-sized avatar

Johannes / universa1 universal

View GitHub Profile
@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
class AdditionalDomain < AR::Base
belongs_to :report
belongs_to :domain
validates :report, presence: true
validates :domain, presence: true
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;
#!/home/steam/.rvm/wrappers/ruby-2.3.1/ruby
oldrev, newrev = ARGV
def run(cmd)
exit($?.exitstatus) unless system "umask 002 && #{cmd}"
end
RAILS_ENV = ENV['RAILS_ENV'] || 'production'
use_bundler = File.file? 'Gemfile'
rake_cmd = use_bundler ? 'bundle exec rake' : 'rake'
## 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 / factorio-current.log - linux client
Last active July 1, 2016 09:43
unable to connect to headless server
0.000 2016-07-01 10:09:07; Factorio 0.13.2 (Build 22949, linux64, steam)
0.118 Operating system: Linux (Ubuntu 16.04)
0.118 Program arguments: "/home/jhedtrich/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio"
0.118 Read data path: /home/jhedtrich/.local/share/Steam/steamapps/common/Factorio/data
0.118 Write data path: /home/jhedtrich/.factorio
0.118 Binaries path: /home/jhedtrich/.local/share/Steam/steamapps/common/Factorio/bin
0.133 Graphics options: [FullScreen: false] [VSync: true] [UIScale: 100%] [MultiSampling: OFF] [Graphics quality: normal] [Video memory usage: high] [Light scale: 20%] [Screen: 255] [DXT: false]
0.341 Available display adapters: 2
0.342 [0]: resolution 2560x1440px at [0,0]
0.342 [1]: resolution 2560x1440px at [2560,0]
@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"],
^
# stock ubuntu 16.04 - xps 13 9343 (2015)
➜ ~ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]