Skip to content

Instantly share code, notes, and snippets.

Severin Perez sevperez

Block or report user

Report or block sevperez

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 abs_fac_1.cs
using System;
namespace abs_fac_1
{
class Program
{
static void Main(string[] args)
{
MonumentHandler greekMonumentHandler =
new MonumentHandler(new GreekMonumentFactory(), "Athena", "Pericles");
View obj_to_func_2.rb
class AuctionHouse
attr_accessor :items, :total_sales
def initialize(items)
@items = items
@total_sales = 0
end
def run_auction(bid_list)
handle_bid_list(bid_list)
View obj_to_func_0.rb
class NumberAnalyzer
attr_accessor :numbers
def initialize(numbers)
@numbers = numbers
end
def print_factorials
numbers.each do |num|
puts "#{num}! = #{factorial(num)}"
View obj_to_func_1.clj
(ns number-analyzer.core)
(declare print-factorials)
(defn -main [& args]
(print-factorials [0 1 2 3 4 5 10]))
; Prints:
; 0! = 1
; 1! = 1
; 2! = 2
View obj_to_func_3.clj
(ns clojure-auction-house.core
(:require [clojure.string :as s :only :join]))
(declare announce-status run-auction)
(defn -main [& args]
(let [auction {:items { "Night Watch" nil "American Gothic" nil "Tower of Babel" nil
"Friend In Need" nil "Potato Eaters" nil "Red Balloon" nil }
:total-sales 0}
bids [["Night Watch" 550000] ["Night Watch" 700000] ["American Gothic" 145000],
View isp_3.cs
using System;
namespace isp_3
{
class Program
{
static void Main(string[] args)
{
var basicStudent = new BasicMathStudent(new BasicCalculator());
View decorator_1.cs
using System;
namespace decorator_1
{
class Program
{
static void Main(string[] args)
{
var msg = "I love C-sharp";
var simpleMsg = new SimpleMessage(msg);
View decorator_0.cs
using System;
namespace decorator_0
{
class Program
{
static void Main(string[] args)
{
var msg = "I love C-sharp";
var simpleMsg = new SimpleMessage(msg);
View strategy_2.rb
module RunStrategies
class RunStrategyInterface
def self.run(name)
raise "Run method has not been implemented!"
end
end
class Jog < RunStrategyInterface
def self.run(name)
puts "#{name} is now jogging at a comfortable pace."
View strategy_1.rb
class Runner
attr_reader :name, :strategy
attr_writer :strategy
def initialize(name, strategy)
@name = name
@strategy = strategy
end
def run
You can’t perform that action at this time.