This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#du -h damit es lesbare werte ausgibt | |
alias du='du -h' | |
#update check kürzer | |
alias agu='sudo apt-get update' | |
#install kürzer | |
alias agi='sudo apt-get install' | |
#upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case interface_typ | |
when "HL7" | |
case interface_version | |
when "2.3.1" | |
Hl7Helper.hl7_2_3_1_export_lab @@actual_konfig_interface | |
else | |
# Do some stuff | |
end | |
when "GDT" | |
case interface_version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InterfaceController < ApplicationController | |
def interface_defintion | |
{ | |
"HL7" => { | |
"Version_2_3" => Services::Interfaces::HL7::Version_2_3.new | |
}, | |
"GDT" => { | |
"Version_2_1" => Services::Interfaces::GDT::Version_2_1.new | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutext_resource_a = Mutex.new | |
mutext_resource_b = Mutex.new | |
resource_a = [] | |
resource_b = [] | |
threads = [] | |
threads << Thread.new do |t| | |
# The number is on purpose so high, so that it will create | |
# a deadlock in your irb as well |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource_a = [] | |
threads = [] | |
threads << Thread.new do |t| | |
50.times do |i| | |
resource_a << i | |
end | |
end | |
threads << Thread.new do |t| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DoorLock | |
def initialize(locked) | |
@locked = locked | |
end | |
def open? | |
!@locked | |
end | |
def unlock! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4.times.map do | |
t = Thread.current | |
t["#{dynamic_variable_name}".to_sym] = method_call | |
end | |
joined_threads = threads.map &:join | |
joined_threads.each do |t| | |
# The keys method returns all thread local variables by names | |
# analog to the Hash#keys method | |
t.keys.each do |key| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DoorLock | |
def initialize(locked) | |
@locked = locked | |
@mutex = Mutex.new | |
end | |
def open? | |
@mutex.synchronize { !@locked } | |
end |
OlderNewer