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
@tsve ➜ spo rvm:(ruby-2.2.3@rails4) scp pi.py u81067@ats24.rmi.yaht.net:pi.py -p 2222 | |
2222: No such file or directory | |
@tsve ➜ spo rvm:(ruby-2.2.3@rails4) | |
@tsve ➜ spo rvm:(ruby-2.2.3@rails4) | |
@tsve ➜ spo rvm:(ruby-2.2.3@rails4) scp pi.py -p 222 u81067@ats24.rmi.yaht.net:pi.py | |
ssh: connect to host ats24.rmi.yaht.net port 22: No route to host | |
lost connection | |
@tsve ➜ spo rvm:(ruby-2.2.3@rails4) scp pi.py -p 2222 u81067@ats24.rmi.yaht.net:pi.py | |
ssh: connect to host ats24.rmi.yaht.net port 22: No route to host | |
lost connection |
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
@tsve ➜ ~ evaluator /home/tsvetelina/elsys/po-homework/2015-2016/A/22/06/ /home/tsvetelina/elsys/asen/elsys-teachers-tools/data/evaluator/scenarios/06.toml -l DEBUG | |
INFO:root:Assignment evaluation | |
INFO:root:Sun Jan 3 01:12:10 2016 | |
INFO:root:Evaluating task1.c | |
WARNING:root:File doesn't match naming convention | |
INFO:root:Evaluating task3.c | |
WARNING:root:File doesn't match naming convention | |
INFO:root:Evaluating task2.c | |
WARNING:root:File doesn't match naming convention |
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 Ability | |
include CanCan::Ability | |
def marshal_dump | |
#blocks cannot be cached | |
@rules.reject{|rule| rule.instance_variable_get :@block }.map{|rule| Marshal.dump(rule) } | |
end | |
def marshal_load array | |
#blocks cannot be cached, so blocks must be re-defined | |
can :read, Comment do |comment| |
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
namespace :exceptions do | |
task :list => :environment do | |
exceptions = [] | |
ObjectSpace.each_object(Class) do |k| | |
exceptions << k if k.ancestors.include?(Exception) | |
end | |
puts exceptions.sort { |a,b| a.to_s <=> b.to_s }.join("\n") | |
end |
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 Account | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
field :subdomain, :type => String | |
embeds_many :users | |
accepts_nested_attributes_for :users | |
validates_presence_of :name, :subdomain | |
validates_uniqueness_of :subdomain, :case_sensitive => false |
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
"testing" | |
) | |
type SusiTest struct { | |
students map[int][]byte |
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
require 'open-uri' | |
require 'yaml' | |
config = YAML.load_file("#{ARGV[0]}") | |
(1..14).each do |lecture_number| | |
File.open("#{config['folder_to_save']}/lecture_#{lecture_number}.pdf", "wb") do |file| | |
filename = config['filename'].gsub('?lecture_number?', lecture_number.to_s) |
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
import unittest | |
import solution | |
class PrivacyFilterTest(unittest.TestCase): | |
def test_filters_international_phone_numbers(self): | |
filter = solution.PrivacyFilter('Phone: +35925551212') | |
self.assertEqual('Phone: [PHONE]', filter.filtered()) |
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
import unittest | |
from solution import wow_such_much | |
class TestDoge(unittest.TestCase): | |
def test_suchmuch_from_15_to_negative(self): | |
self.assertEqual( | |
wow_such_much(15, -3), | |
['suchmuch', '14', '13', 'such', '11', 'much', 'such', '8', '7', 'such', |