Skip to content

Instantly share code, notes, and snippets.

View rockarts's full-sized avatar
💭
🐝 🇨🇦

Steven Rockarts rockarts

💭
🐝 🇨🇦
  • Edmonton, AB
View GitHub Profile
@rockarts
rockarts / ticket.cs
Last active June 17, 2024 15:26
HackerRank
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
@rockarts
rockarts / nominees.json
Last active April 11, 2021 23:28
2021 Oscar Nominees JSON
{
"categories": [{
"category": {
"name": "Actor in a Leading Role",
"nominees": [{
"person": "Riz Ahmed",
"movie": "Sound of Metal"
},
{
"person": "Chadwick Boseman",
@rockarts
rockarts / silicon_valley.txt
Created November 23, 2020 01:50
Silicon Valley Binary
01100110 01101001 01101110 01100100 00100000 01100001 00100000 01101000 01101111 01100010 01100010 01111001 00100000 01100110 01101111 01110010 00100000 01100111 01101111 01100100 00100111 01110011 00100000 01110011 01100001 01101011 01100101 00100000 01100110 01101001 01101110 01100100 00100000 01100001 00100000 01101000 01101111 01100010 01100010 01111001 00100000 01100110 01101111 01110010 00100000 01100111 01101111 01100100 00100111 01110011 00100000 01110011 01100001 01101011 01100101
@rockarts
rockarts / trie.ts
Created September 4, 2020 03:40
Trie in Typescript
class TrieNode {
parent: TrieNode | null;
children: any = {}
key: string | null;
isTerminating = false
constructor(key: string | null, parent: TrieNode | null) {
this.key = key;
this.parent = parent
}
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let draw = DrawView(frame: self.view.bounds)
view.addSubview(draw)
}
for xvalue in stride(from: x, through: width, by: step) {
for yvalue in stride(from: y, through: height, by: step) {
drawLine(x: xvalue,y: yvalue, width: step, height: step)
}
}
var step = 20;
for(var x = 0; x < size; x += step) {
for(var y = 0; y < size; y+= step) {
draw(x, y, step, step);
}
}
func drawLine(x:Int, y:Int, width:Int, height:Int) {
let leftToRight:Bool = Bool.random()
let path = UIBezierPath()
if(leftToRight) {
path.move(to: CGPoint(x: x, y: y))
path.addLine(to: CGPoint(x: x + width, y: y + height))
} else {
path.move(to: CGPoint(x: x + width, y: y))
class DrawView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func draw( _ rect: CGRect) {
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let draw = DrawView(frame: self.view.bounds)
view.addSubview(draw)
}
}
class DrawView: UIView {
override init(frame: CGRect) {