Skip to content

Instantly share code, notes, and snippets.

@snowe2010
snowe2010 / rejectBlankLinesRuby
Created October 7, 2012 06:26
Removing blank lines from an array in ruby
lines_after_strip.reject! { |line| line.empty? }
@snowe2010
snowe2010 / symbolCheck.rb
Created October 9, 2012 09:16
Checks if the current command is an int or a symbol
if current_command.scan(/^\d+$/).length > 0
@snowe2010
snowe2010 / to_15_binary.rb
Created October 10, 2012 06:17
Add 0s for 16 bits Ruby
binary.insert(0,'0') while binary.length < 15
@snowe2010
snowe2010 / scanfile.rb
Created December 4, 2012 05:17
Scans array elements for tokens then writes them to a file, token_type(t) returns the xml for that token
@whitespace_clean.each { |t| t.scan(/".*?"|\w+|[\[\]\.\(\){};=,+\-<>~\&\*\/\|]/) {|t| @write_file.write(token_type(t)) }}
@snowe2010
snowe2010 / cleanwhitespace.rb
Created December 4, 2012 05:18
Cleans the whitespace and comments from the file and returns them to a clean array
@read_file.lines.to_a.each {|line| @whitespace_clean << line.gsub(/\/\/.*?$|\/\*.*?\*\/|\t\m|\*.*$|\/\*\*.*$/,"").strip}
@snowe2010
snowe2010 / boxstarter.txt
Last active January 1, 2016 16:59
This is my Boxstarter installation script for initial setup of a Windows 7+ box. It's still a work in progress.
Update-ExecutionPolicy Unrestricted -Force
Disable-UAC
Set-TaskbarSmall
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
# dropbox first so it can start syncing the thousands of files I have
cinst dropbox
cinst greenshot
cinst GoogleChrome
@snowe2010
snowe2010 / box40.ps1
Created December 30, 2013 06:45
Boxstarter issue 40 test script for race condition
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst GoogleChrome
cinst javaruntime
cinst firefox
cinst ccleaner
cinst skype
cinst dropbox
cinst windirstat
@snowe2010
snowe2010 / work_boxstarter
Last active August 29, 2015 14:09
Boxstarter for work programs (less junk)
# http://boxstarter.org/package/nr/url?https://gist.github.com/snowe2010/7d533cdcb015b76a0413/raw
Update-ExecutionPolicy Unrestricted -Force
Disable-UAC
Set-TaskbarSmall
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
#Enable-RemoteDesktop
# dropbox first so it can start syncing the thousands of files I have
cinst dropbox
cinst launchy
@snowe2010
snowe2010 / test_install_ruby
Last active August 29, 2015 14:14
test for ruby installs
# http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/snowe2010/5dfbedd68535eed523dc/raw
Update-ExecutionPolicy Unrestricted -Force
cinst ruby -version 1.9.3.55100 -Force
cinst ruby -version 1.8.7.37402 -Force
cinst ruby.devkit -Force
#cinst ruby -o -ia $rubyFolder = '193' $url = 'http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-1.9.3-p545.exe?direct' $checksum = '05398a6cd920ccd297c28150a935ef72'
#cinst ruby -o -ia $rubyFolder = '187' $url = 'http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-1.8.7-p374.exe?direct' $checksum = '2e33a098f126275f7cb29ddcd0eb9845'
# Install ruby 2.0, 2.1.5, and the ruby 2 devkit
cinst ruby -version 2.0.59800 -Force
@snowe2010
snowe2010 / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.