Skip to content

Instantly share code, notes, and snippets.

=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
{
"id": "f422525e-c2f9-43a8-a349-fef5c9498834",
"name": "httpbin_web",
"values": [
{
"key": "url",
"value": "http://httpbin.org",
"enabled": true,
"type": "text"
}
@a-chumagin
a-chumagin / wait.js
Created June 20, 2018 12:20
wait condition
console.log('Waiting for job completion in step "' + request.name + '"');
// Construct our request URL from environment variables
var url = `http://${pm.environment.get('wiremock')}/__admin/requests`;
var retryDelay = 2000;
var retryLimit = 10;
function isProcessingComplete(retryCount) {
pm.sendRequest(url, function (err, response) {

10 Scala One Liners to Impress Your Friends

Here are 10 one-liners which show the power of scala programming, impress your friends and woo women; ok, maybe not. However, these one liners are a good set of examples using functional programming and scala syntax you may not be familiar with. I feel there is no better way to learn than to see real examples.

Updated: June 17, 2011 - I'm amazed at the popularity of this post, glad everyone enjoyed it and to see it duplicated across so many languages. I've included some of the suggestions to shorten up some of my scala examples. Some I intentionally left longer as a way for explaining / understanding what the functions were doing, not necessarily to produce the shortest possible code; so I'll include both.

1. Multiple Each Item in a List by 2

The map function takes each element in the list and applies it to the corresponding function. In this example, we take each element and multiply it by 2. This will return a list of equivalent size, compare to o

@a-chumagin
a-chumagin / notes.txt
Created May 28, 2019 20:01
install Kubernetes cluster
The first thing that we are going to do is use SSH to log in to all machines. Once we have logged in, we need to elevate privileges using sudo.
sudo su
Disable SELinux.
setenforce 0
sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
Enable the br_netfilter module for cluster communication.
modprobe br_netfilter
echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables
Ensure that the Docker dependencies are satisfied.
@a-chumagin
a-chumagin / Dockerfile
Last active June 21, 2019 20:47
simple_flask_server
FROM alpine:latest
RUN apk update && apk add python3
RUN python3 -m ensurepip
COPY ./requirements.txt /opt/flask_auth/requirements.txt
WORKDIR /opt/flask_auth
RUN pip3 install -r requirements.txt
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@a-chumagin
a-chumagin / Link
Created December 17, 2019 05:37
DeepTraffic is a deep reinforcement learning competition
@a-chumagin
a-chumagin / google-maps-polygon-coordinates-tool.markdown
Created February 11, 2020 12:17
Google Maps Polygon Coordinates Tool

Google Maps Polygon Coordinates Tool

Outputs the coordinates (longitude, latitude) for Google Maps whenever the Polygon is moved or re-shaped. Recently added a 'Copy to Clipboard' button and had data output into a textarea for easier copying & pasting

I originally built this to build map outlines for neighborhoods, villages, districts and counties - specifically for real estate purposes.

A Pen by Jeremy Hawes on CodePen.

License.

POLYGON((33.59601218050673 -96.19406055623665,33.59714961149158 -96.19402300531044,33.59716301634673 -96.19508813624537,33.59602111719493 -96.19512032275355,33.59601218050673 -96.19406055623665))