Skip to content

Instantly share code, notes, and snippets.

View tejo's full-sized avatar

Matteo Parmi tejo

View GitHub Profile
@tejo
tejo / change_calculator.rb
Last active February 26, 2022 10:48
cleo coding challenge
# frozen_string_literal: true
class ChangeCalculator
COINS = { 200 => '£2', 100 => '£1', 50 => '50p', 20 => '20p', 10 => '10p', 5 => '5p', 2 => '2p', 1 => '1p' }.freeze
def self.calculate(amount)
new(amount).calculate
end
def initialize(amount)
package main
import (
"fmt"
"log"
"net/http"
"runtime"
"time"
)
@tejo
tejo / cloudSettings
Last active March 5, 2020 12:36
vscode-settings
{"lastUpload":"2020-03-05T12:36:19.246Z","extensionVersion":"v3.4.3"}
Entering CLI Mode, type 'exit' to return, or 'help'
# dump
# version
# RaceFlight "RF" 1.9.9 "BB""320" - FS update /REVO Sep 11 2016 / 21:29:22 (e714ceb)
# dump master
# mixer
mixer QUADXL
#!/bin/bash
set -e
set -o pipefail
dfu-util --alt 0 -s 0x08000000:force:unprotect -D "$1"
sleep 5
dfu-util -R -a 0 -D "$1"
@tejo
tejo / main.go
Last active August 29, 2015 14:22
package main
import (
"database/sql"
"log"
"net/http"
_ "github.com/go-sql-driver/mysql"
"github.com/gorilla/pat"
)
source 'https://rubygems.org'
gem 'sinatra'
gem 'thingiverse'
gem 'pry'
<form action="/" method="POST">
<h3> Messaggio </h3>
<input type="text" name="message" value=<%= params[:message] %>>
<h3> Email </h3>
<input type="text" name="email" value=<%= params[:email] %>>
<input type="submit" value="Inserisci ">
</form>
<% @messages.each do |m| %>
# encoding: utf-8 #per caratteri italiani
class MotherNature
attr_accessor :animals
def initialize
@animals = []
end
class Album
attr_accessor :band, :title, :year, :tracks
def initialize(title, band, year)
@title = title
@band = band
@year = year
@tracks = []
end