Skip to content

Instantly share code, notes, and snippets.

View theomarkkuspaul's full-sized avatar
🏎️
window seat!

Theo Paul theomarkkuspaul

🏎️
window seat!
View GitHub Profile
@straker
straker / README.md
Last active July 15, 2024 16:33
Basic Pong HTML and JavaScript Game

Basic Pong HTML and JavaScript Game

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.

Further Exploration

  • Score
  • When a ball goes past a paddle, the other player should score a point. Use context.fillText() to display the score to the screen
@crypticmind
crypticmind / README.md
Last active July 12, 2024 09:34
Setup lambda + API Gateway using localstack
@soultech67
soultech67 / ruby_readline_issue.md
Last active June 6, 2022 21:18
ruby bundler: Sorry, you can't use byebug without Readline

Preamble

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
@msmfsd
msmfsd / es7-async-await.js
Last active February 4, 2024 17:38
Javascript fetch JSON with ES7 Async Await
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved
@NTag
NTag / remoteAtom.md
Last active December 19, 2023 12:09
How to install and use remote-atom

Installation

  1. Install Atom on your computer (https://atom.io)

  2. Launch Atom, go in Preferences, then chose Install, search for "remote-atom", and install it

  3. On the distant machine:

    cd ~
    wget https://raw.githubusercontent.com/aurora/rmate/master/rmate
    chmod +x rmate
@cmkoller
cmkoller / sinatra-flash.md
Last active July 25, 2021 07:34
Setting up Sinatra Flash

Setting Up Sinatra Flash

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!

  1. Install the gem by typing gem install sinatra-flash in your terminal.
  2. Require the gem in the top of your server.rb file: require 'sinatra/flash'
@rob-murray
rob-murray / siege_examples.sh
Last active April 1, 2024 03:48
Siege examples
# 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/'
@lfender6445
lfender6445 / gist:9919357
Last active July 25, 2024 02:05
Pry Cheat Sheet

Pry Cheat Sheet

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 session

Debugger

@tedmiston
tedmiston / nodejs-tcp-example.js
Last active May 20, 2024 11:27
Node.js TCP client and server example
/*
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');
@gittmaan
gittmaan / rbenv-install-system-wide.sh
Created July 23, 2012 22:54 — forked from v1nc3ntlaw/rbenv-install-system-wide.sh
rbenv install ruby 1.9.3-p194 on Ubuntu
# 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