Skip to content

Instantly share code, notes, and snippets.

View falonofthetower's full-sized avatar

Peter Karth falonofthetower

  • CompanyCam
  • Sanford, NC
View GitHub Profile
require 'pry'
WINS = [[1,2,3], [4,5,6], [7,8,9],
[1,4,7], [2,5,8], [3,6,9],
[1,5,9], [3,5,7]]
def initialize_board
board = Hash[(1..9).to_a.zip((1..9).to_a)]
end
@falonofthetower
falonofthetower / extended_shuffle
Last active August 29, 2015 14:11
Extended Shuffle
class Card
attr_accessor :value, :suit
def initialize(v, s)
@value = v
@suit = s
end
end
class Deck
#!/bin/bash
# Detach sublime from terminal
nohup /opt/sublime_text_2/sublime_text --class=sublime-text-2 "$@" 2>/dev/null &
list = ([ {name: 'Bart'}, {name: 'Lisa'}, {name: 'Maggie'} ])
list2 = ([ {name: 'Bart'}, {name: 'Lisa'} ])
list3 = ([ {name: 'Bart'} ])
def transform set
names = ''
list_length = set.length
set.each_with_index do |name, index|
if index + 2 == list_length
name[:name].insert(-1, " & ")
elsif index + 1 != list_length
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-unimpaired'
Plugin 'tpope/vim-repeat'
Plugin 'flazz/vim-colorschemes'
<h1>Please log in</h1>
<div class='well'>
<%= form_tag '/login' %>
<div class='control-group'>
<%= label_tag :username %>
<%= text_field_tag :username, params[:username] || '' %>
</div>
<div class='control-group'>
# Need root
sudo su -
# Install dependancies
apt-get -y update && apt-get -y install unzip screen mono-runtime libmono-system-core4.0-cil libmono-sqlite4.0-cil libmysql-cil-dev libmono-system-runtime-serialization4.0-cil libmono-web4.0-cil libmono-system-xml-linq4.0-cil
# Add terraria group and user
sudo groupadd --gid 70001 terraria
sudo useradd --gid 70001 -d /home/terraria -m --uid 70001 -s /bin/bash terraria
```ruby
your code here
```
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-unimpaired'
Plugin 'tpope/vim-repeat'
Plugin 'flazz/vim-colorschemes'
begin
puts "Please enter your first number."
a = gets.chomp
puts "Please enter your second number."
b = gets.chomp
puts "Here are your instructions...."
puts "Enter + if you want to add the numbers."
puts "Enter - if you want to subtract the numbers."