{{ message }}

Instantly share code, notes, and snippets.

# Tyler Rockwood rockwotj

Last active Aug 29, 2015
A couple of common combinatorics question solutions in C#
View C# Combinatorics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 public static List> GeneratePowerSet(List list) { var result = new List>(); if (list.Count > 0) { foreach (var t in GeneratePowerSet(list.GetRange(1, list.Count - 1))) { result.Add(t); var temp = DeepCopy(t); temp.Add(list[0]);
Last active Aug 29, 2015
Programming practice for interviews - Don't use an IDE!
View Questions.md
1. Take an absolute path and reduce it: /a/b/../foo.txt -> /a/foo.txt, /a/../b/./foo.txt -> /b/foo.txt

2. You are given an array representing integer. Write a function which increments this integer. Example: input [1,2,3] -> output [1,2,4] which represents 123 + 1 = 124

3. Given an unbalanced binary tree, write code to select a node at random (each node has an equal probability of being selected).

Created Dec 6, 2015
A short ruby script to cross platform a golang project
View godist.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #! /usr/bin/env ruby if not ARGV[0] or ARGV[0] == "-h" puts "Usage: ./go_dist " exit end project_path = ARGV[0] project = project_path.split('/')[-1] puts "\e[1mStarting distribution of \e[32m'#{project}'\e[0m" platforms = {
Last active Jan 9, 2016
Firebase bolt rules for the Moviequotes App
View moviequote-rules.bolt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 path /quotes { write() = true; read() = true; } path /quotes/\$moviequote is Moviequote; type Moviequote { movie: String, quote: String
Last active Jan 9, 2016
Firebase bolt rules for the Password Keeper App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Last active Jan 20, 2016
Firebase bolt rules for the Weatherpics With Auth App
View weatherpics-rules.bolt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 type Weatherpic { caption: String | Null, imageUrl: String, uid: UserID } type UserID extends String; path /weatherpics { read() { true }
Last active Jan 7, 2017
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/usr/bin/env python import sys import os import argparse from os import path from os.path import isfile as exists import signal import json import xml.etree.ElementTree as ET
Last active Jun 28, 2017
An example in python on using the Stackdriver Monitoring API to query your Firebase Realtime Database's average load over the past day