Skip to content

Instantly share code, notes, and snippets.

View nakov's full-sized 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 January 13, 2013 11:47
Nakov.IO.Cin
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 February 22, 2017 17:44
agency-html-course-softuni
@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 February 22, 2017 19:09
ageny softuni feb 2017 part 2
@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 February 23, 2017 11:22
Consulting Agency - Finished (SoftUni Exercise - 23-Feb-2017)
@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 October 30, 2017 13:39
RageQuit - No RegEx
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()
@nakov
nakov / Files.cs
Created October 30, 2017 15:01
Files
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 October 30, 2017 16:40
Command Interpreter - working solution
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 February 14, 2018 16:06
Solidity Insecure Random Generator
// 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 February 20, 2018 10:19
Document Registry - Infura API (accessed through Web3.js)
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 February 20, 2018 10:21
Start RSK Node in Windows - Example
blockchain.config.name = "regtest"
peer {
discovery = {
# if peer discovery is off
# the peer window will show
# only what retrieved by active
# peer [true/false]