Skip to content

Instantly share code, notes, and snippets.

taboularasa / using apt-key add
Last active Oct 12, 2021
alternative to `apt-key add` for installing Debian packages
View using apt-key add
curl -sLS | apt-key add - && \
echo "deb stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install --no-install-recommends yarn
taboularasa / caesar.rb
Created May 4, 2021
implement caesar cipher
View caesar.rb
def transpose(message, mapping) {|e| mapping[e]}.join
puts "encode or decode?"
selected_action = gets.chomp
puts "what is the key?"
key = gets.chomp
puts "what is your message?"
message = gets.chomp
View exercise.rb
# Although our analytics team produces a styling algorithm
# it can't always capture everything a customer has requested.
# For example, a customer might write in their note to the stylist
# "Please no pink!!!". The algorithm can't always tell that,
# so it might suggest pink clothes for the customer.
# Suppose the stylist has the ability to manually filter out
# attributes the customer wants to avoid. What we'd like
# you to do is, given a list of items, and a list of

Keybase proof

I hereby claim:

  • I am taboularasa on github.
  • I am davidelliott ( on keybase.
  • I have a public key whose fingerprint is 7948 9BB4 CE88 AFE3 F563 501A BC46 D821 0F21 0480

To claim this, I am signing this object:

View flatten.rb
require 'minitest/autorun'
# Implement flatten
# ruby -Ilib:test flatten.rb
def flatten(accumulator, element)
if element.is_a? Array
element.each {|e| flatten(accumulator, e)}
View .laptop.local
brew_tap 'caskroom/cask'
brew_install_or_upgrade 'brew-cask'
brew cask install google-chrome
sudo mv /opt/homebrew-cask/Caskroom/google-chrome/latest/Google\ /Applications
brew cask install chromium
brew cask install firefox
taboularasa / a_user.rb
Last active Aug 29, 2015
Class Extraction Example
View a_user.rb
class User
def id
def name
def age
taboularasa / gist:dcbf95daf2c61c38b607
Last active Aug 29, 2015
cascading selects in angular
View gist:dcbf95daf2c61c38b607
<div ng-controller="TeacherReportsController">
<select ng-options="element.label for element in model" ng-model="firstOption"></select>
<select ng-options="child.label for child in firstOption.children" ng-model="secondOption"></select>
<select ng-options="child.label for child in secondOption.children" ng-model="thirdOption"></select>
View gist:2d4fdaec2afc34d01eb8
layout title
Validating acyclic graphs

Alexis King and I were building an inventory management system for a Widget factory. In the warehouse they have a variety of containers that can hold either widgets or other containers. We needed to provide an inventory management system for the warehouse manager to keep track of the whereabouts of each container and widget. Here's how it needed to work:

  1. Manager logs into the inventory management system
  2. Manager navigates to the show view for an Inventory Location (i.e. a warehouse)
  3. Manager clicks on manage containers
View gist:69cc9f132642541155cb
Feature: Customer account
Scenario: viewing account information
Given I am a logged in customer
And I am viewing my dashboard
When I click the ACCOUNT link in the navigation
Then I should see a form with my account information filled in
Scenario: editing account information
Given I am a logged in customer
And I am viewing my dashboard