This file contains hidden or 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
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 |
This file contains hidden or 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
class Card | |
attr_accessor :value, :suit | |
def initialize(v, s) | |
@value = v | |
@suit = s | |
end | |
end | |
class Deck |
This file contains hidden or 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
#!/bin/bash | |
# Detach sublime from terminal | |
nohup /opt/sublime_text_2/sublime_text --class=sublime-text-2 "$@" 2>/dev/null & |
This file contains hidden or 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
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 |
This file contains hidden or 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
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' |
This file contains hidden or 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
<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'> |
This file contains hidden or 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
# 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 | |
This file contains hidden or 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
```ruby | |
your code here | |
``` |
This file contains hidden or 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
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' |
This file contains hidden or 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
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." |
OlderNewer