Skip to content

Instantly share code, notes, and snippets.

View annawinkler's full-sized avatar

Anna Rajendran annawinkler

View GitHub Profile
@annawinkler
annawinkler / Sphero Workshop Outline
Last active December 31, 2015 01:09
Sphero Workshop Outline
Sphero Workshop
===============
The goal of the workshop is to introduce basic programming and logic concepts through fun activities with Sphero.
Technology
----------
We use Ruby and Macrolab depending on age and prior programming experience. We have mobile devices (iPads, iPad minis, Nexus 7 tablets) to run the Macrolab application. We have Mac Books with Ruby 1.9.3 for Ruby programming with Sphero for older kids and those with more experience and/or interest in Ruby development.
This file has been truncated, but you can view the full file.
Script started on Tue Feb 4 10:19:40 2014
[?1034hbash-3.2$ ls
Vagrantfile Vagrantfile~ package.box typescript
bash-3.2$ vagrant up --debug
INFO global: Vagrant version: 1.4.3
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Darwin"
Script started on Mon Feb 10 13:32:30 2014
Identity added: /Users/afowleswinkler/.ssh/id_rsa_afowles_oracle (/Users/afowleswinkler/.ssh/id_rsa_afowles_oracle)
[?1034hbash-3.2$ ls
Vagrantfile typescript
bash-3.2$ vagrant up --debug
INFO global: Vagrant version: 1.4.3
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
#
# This file demonstrates a Caesar cipher
# There is an encrypt function for encoding plaintext into ciphertext
# and a decrypt function for converting ciphertext into plaintext
#
# given plaintext and key, return encoded ciphertext
def encrypt(plaintext, key, letters)
plaintext_as_numbers = []
# Represent each plaintext letter as a corresponding number
#
# This file demonstrates FizzBuzz in Ruby
#
(1..20).each do |number|
puts "Checking #{number}"
puts "FIZZ" if number % 3 == 0
puts "BUZZ" if number % 5 == 0
end
def decrypt( ciphertext, key ):
""" given ciphertext and key, return decoded plaintext"""
# Represent each plaintext letter as a corresponding number
# for example a=>0, b=>1, ... y=>25, z=>26, '<space>'=>27
ciphertext_as_numbers = []
for l in ciphertext.lower():
ciphertext_as_numbers.append( letters.index(l) )
# encryption... Ceaser cipher shift
def decrypt(ciphertext, key, letters)
# Represent each plaintext letter as a corresponding number
# for example a=>0, b=>1, ... y=>25, z=>26, '<space>'=>27
ciphertext_as_numbers = []
ciphertext.downcase.each_char do |l|
ciphertext_as_numbers << letters.index(l)
end
# encryption... Caesar cipher shift
# add the key to each number and mod by 27
@annawinkler
annawinkler / gist:11005811
Created April 17, 2014 19:18
haproxy demo
bundle exec ruby start.rb haproxy.cfg.simple
bundle exec ruby start.rb haproxy.cfg.group_example
bundle exec ruby start.rb haproxy.cfg.server_error_pages
@annawinkler
annawinkler / Holiday LED Lights
Last active August 29, 2015 14:11
Adafruit Arduino with Pro Trinket 5V
For the mac - try installing the driver: http://www.ftdichip.com/Drivers/VCP.htm
Install the Adafruit Arduino:
- Open the mac *.gz file
- Drag the app to applications
- Open Adafruit Arduino
- You might need to install Java - click more info & download & install Java
- Copy contents of the holiday GSA\Arduino to Documents\Arduino
Set the board type:
@annawinkler
annawinkler / Ruby Workshop
Last active August 29, 2015 14:16
Ruby Workshop
Want to learn more?
* The Ruby website https://www.ruby-lang.org/en/
* Ruby gems (libraries) https://rubygems.org/
* Ruby Documentation http://ruby-doc.org/
* Article Ruby Gems for Command-Line Apps: http://www.awesomecommandlineapps.com/gems.html
Online Learning
* Code Academy Ruby - http://www.codecademy.com/en/tracks/ruby
* Programming Ruby - http://ruby-doc.com/docs/ProgrammingRuby/