ICE Out; Abolish ICE
This is a basic implementation of the Atari Pong game, but it's missing a few things intentionally and they're left as further exploration for the reader.
Example on how to run locally an AWS Lambda via API Gateway using localstack.
Based on...
On OS/X Sierra, after recently running a brew update I started receiving the error message Sorry, you can't use byebug without Readline when trying to run some rake tasks in my ruby project folder. I observed this in projects and gems that include byebug or pry in their Gemfile or gem.spec. I've found in my googling that many begin encountering this error message after running a brew update but there are other triggering conditions as well.
>> rake aws:show_config
WARN: Unresolved specs during Gem::Specification.reset:
mime-types (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Sorry, you can't use byebug without Readline. To solve this, you need to
Install Atom on your computer (https://atom.io)
Launch Atom, go in Preferences, then chose Install, search for "remote-atom", and install it
On the distant machine:
cd ~
wget https://raw.githubusercontent.com/aurora/rmate/master/rmate
chmod +x rmate
Sinatra Flash is an awesome gem that allows you to pop up little messages alerting your users of important things, via some simple code in your server.rb file. This is very useful for things like displaying error messages if the user has filled out a form wrong, or displaying "success" messages if the user did something successfully like sign in, sign out, or submit a form.
This also gives you a great chance to implement Foundation's beautiful alerts. Here's how to set it up!
gem install sinatra-flash in your terminal.require 'sinatra/flash'| # Basic example | |
| siege -t60s -c20 -d10 'http://robertomurray.co.uk/' | |
| # Basic auth; | |
| auth=$(echo -n 'username:password' | openssl base64) | |
| siege -t60s -c20 -d10 --header="Authorization:Basic $auth" 'https://staging.a-hostname.co.uk/' |
Command Line
pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb - load your rails into a pry sessionDebugger
| /* | |
| In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
| server, but for some reason omit a client connecting to it. I added an | |
| example at the bottom. | |
| Save the following server in example.js: | |
| */ | |
| var net = require('net'); |
| # Update, upgrade and install development tools: | |
| apt-get update | |
| apt-get -y upgrade | |
| apt-get -y install build-essential git-core curl libssl-dev \ | |
| libreadline6 libreadline6-dev \ | |
| zlib1g zlib1g-dev \ | |
| libmysqlclient-dev \ | |
| libcurl4-openssl-dev \ | |
| libxslt-dev libxml2-dev |
| #!/usr/bin/env ruby | |
| =begin | |
| install Sinatra: gem install sinatra | |
| install Shotgun: gem install shotgun (this auto-reloads sinatra on every http request - which means every time you make a change in your code you don't have to stop then start sinatra) | |
| To just run your code using Sinatra: ruby name-of-file.rb | |
| To run your code using Shotgun (which is just Sinatra but with ability to auto-reload when changes are made to files): shotgun name-of-file.rb | |
| The following examples are run using Shotgun and the URL is: http://127.0.0.1:9393/ |