Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focused on the global SoftUni expansion: https://softuni.org

Svetlin Nakov nakov

🎯
Focused on the global SoftUni expansion: https://softuni.org
View GitHub Profile
@nakov
nakov / Cin.cs
Created Jan 13, 2013
Nakov.IO.Cin
View Cin.cs
namespace Nakov.IO
{
using System;
using System.Text;
using System.Globalization;
/// <summary>
/// Console input helper for C# and .NET. Allows simplified reading of numbers and string
/// tokens from the console in a way similar to "cin" in C++ and java.util.Scanner in Java.
/// </summary>
@nakov
nakov / agency.css
Created Feb 22, 2017
agency-html-course-softuni
View agency.css
@import "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css";
.site-header, .site-footer, main section {
border: 1px solid blue;
margin: 10px;
}
.industries article {
width: 300px;
border: 1px solid green;
@nakov
nakov / agency.css
Created Feb 22, 2017
ageny softuni feb 2017 part 2
View agency.css
@import "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css";
@import url('https://fonts.googleapis.com/css?family=Montserrat');
body {
font-family: Montserrat, sans-serif;
font-size: 14px;
margin: 0;
}
@nakov
nakov / agency.css
Created Feb 23, 2017
Consulting Agency - Finished (SoftUni Exercise - 23-Feb-2017)
View agency.css
@import "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css";
@import url('https://fonts.googleapis.com/css?family=Montserrat');
* {
word-wrap: break-word;
}
body, section, header, footer {
margin: 0;
@nakov
nakov / RageQuit.cs
Created Oct 30, 2017
RageQuit - No RegEx
View RageQuit.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
class RageQuit
{
static void Main()
View Files.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
class Files
{
static void Main()
{
var n = int.Parse(Console.ReadLine());
@nakov
nakov / CommandInterpreter.cs
Created Oct 30, 2017
Command Interpreter - working solution
View CommandInterpreter.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class CommandInterpreter
{
static void Main()
@nakov
nakov / InsecureRandomGenerator.sol
Created Feb 14, 2018
Solidity Insecure Random Generator
View InsecureRandomGenerator.sol
// Insecure random generator for Solidity. Can be manipulated by the miners
contract InsecureRandomGenerator {
bytes32 public randseed;
function pseudoRandom(uint start, uint end) returns (uint) {
bytes32 prevBlockHash = block.blockhash(block.number-1);
randseed = keccak256(randseed, prevBlockHash, block.timestamp,
block.coinbase, block.difficulty, block.number);
uint range = end - start + 1;
@nakov
nakov / Cert.sol
Last active Feb 20, 2018
Document Registry - Infura API (accessed through Web3.js)
View Cert.sol
pragma solidity ^0.4.18;
contract Cert {
mapping (string => bool) private certificateHashes;
address contractOwner = msg.sender;
function add(string hash) public {
require (msg.sender == contractOwner);
certificateHashes[hash] = true;
}
@nakov
nakov / rsk-node.conf
Created Feb 20, 2018
Start RSK Node in Windows - Example
View rsk-node.conf
blockchain.config.name = "regtest"
peer {
discovery = {
# if peer discovery is off
# the peer window will show
# only what retrieved by active
# peer [true/false]