Skip to content

Instantly share code, notes, and snippets.

View ViktorSimko's full-sized avatar
🐿️

Viktor Szilárd Simkó ViktorSimko

🐿️
  • Debrecen, Hungary
View GitHub Profile
@martin-lalev
martin-lalev / UIViewHierarchyBuilder.swift
Last active December 23, 2022 09:37
Lightweight DSL for defining UIView hierarchy using Swift 5.1's function builders.
protocol UIViewArrayConvertible {
func items() -> [UIView]
}
extension UIView: UIViewArrayConvertible {
func items() -> [UIView] { [self] }
}
extension Array: UIViewArrayConvertible where Element: UIView {
func items() -> [UIView] { self }
}
#!/bin/bash
printf "RGB: %02X%02X%02X\n" "$1" "$2" "$3"
@mycodeschool
mycodeschool / Stack_ArrayImplementation_OOP.cpp
Created October 8, 2013 02:44
An object oriented implementation of stack using arrays in C++.
// Stack - Object oriented implementation using arrays
#include <iostream>
using namespace std;
#define MAX_SIZE 101
class Stack
{
private:
int A[MAX_SIZE]; // array to store the stack
int top; // variable to mark the top index of stack.