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 'tempfile' | |
| require 'rubygems' | |
| require 'zip' | |
| file = Tempfile.open('testing.txt') | |
| file.write('this is some secret text here') | |
| file.rewind | |
| zipbuffer = Zip::OutputStream.write_buffer(::StringIO.new(''), Zip::TraditionalEncrypter.new('password')) do |out| | |
| out.put_next_entry("testing.txt") |
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
| # # echo is like puts for bash (bash is the program running in your terminal) | |
| # echo "Loading ~/.bash_profile a shell script that runs in every new terminal you open" | |
| # # $VARIABLE will render before the rest of the command is executed | |
| # echo "Logged in as $USER at $(hostname)" | |
| # Load RVM into a shell session *as a function* | |
| [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" | |
| # Path for RVM | |
| test -d "$HOME/.rvm/bin" && PATH="$PATH:$HOME/.rvm/bin" |
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
| def game_rules(items) | |
| boat_west = items[0] | |
| wolf_west = items[1] | |
| duck_west = items[2] | |
| grain_west = items[3] | |
| return false if (!wolf_west && !duck_west) && boat_west | |
| return false if (!duck_west && !grain_west) && boat_west | |
| return false if (wolf_west && duck_west) && !boat_west | |
| return false if (duck_west && grain_west) && !boat_west | |
| true |
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
| # Data structure for square | |
| class Square | |
| attr_accessor :in, :frontier | |
| attr_reader :walls | |
| def initialize | |
| @walls = (0..3).to_a | |
| @in = false | |
| @frontier = false | |
| 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
| # Get all the tweets in an array of hashes | |
| tweets = [] | |
| File.open('sample_input.txt') do |f| | |
| tweets = f.map do |line| | |
| { | |
| user: line[/^\w+(?=:)/], | |
| mentions: line.scan(/(?<=@)\w+/) | |
| } | |
| end | |
| 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="style.css"> | |
| <meta charset="UTF-8"> | |
| <title></title> | |
| </head> | |
| <body> | |
| <article> | |
| <img src="" alt=""> |
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
| # This script examines school report card data 2014-2015 | |
| # Data downloaded from https://github.com/dailyherald/SchoolReportCards | |
| setwd(dir = "~/Desktop/") | |
| me <- read.csv(file = "me2015.csv") | |
| dem <- read.csv(file="rc2015dem.csv") | |
| # head(me) #query headers | |
| # summary(me) #query summary | |
| # str(dem) #query structure | |
| colnames(me) | |
| together <- merge(x=me, |
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
| notifications: | |
| slack: islandfoxes2016:rvZVP0uhyIWkffUwuBAusagy | |
| language: ruby | |
| rvm: | |
| - 2.1.7 | |
| services: | |
| - postgresql |
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
| $(document).ready(function() { | |
| getNewHorsePage() | |
| .done(makeHiddenForm); | |
| $('#new-horse').on('click', function() { | |
| event.preventDefault(); | |
| toggleForm(); | |
| }); | |
| $('body').on('submit', '#horse-form', function() { |
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
| <head> | |
| <link rel="stylesheet" href="/css/normalize.css"> | |
| <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | |
| <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css"> | |
| <link rel="stylesheet" href="/css/application.css"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> | |
| <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/js/materialize.min.js"></script> | |
| <script src="/js/application.js"></script> |
NewerOlder