Skip to content

Instantly share code, notes, and snippets.

View matisnape's full-sized avatar

Anna Anks Nowak matisnape

View GitHub Profile
@matisnape
matisnape / curl.json
Created March 15, 2019 13:44
create evaluation
curl -X POST \
https://api.recruitee.com/c/1111/interview/candidates/592074/results \
-H 'Accept: application/json, text/plain, */*' \
-H 'Authorization: Bearer token' \
-d '{
"interview_result": {
"kind": "template_form",
"rating": "yes",
"rating_note": "<p>testtest</p>",
"interview_template_name": "Developer template",
@matisnape
matisnape / scroll2.rb
Last active September 14, 2018 09:49
Capybara - useful code snippets
loop do
break if profile_page.has_resume?
profile_page.execute_script(
"document.querySelector('.dialog-scroll-container').scrollTo(0, 1000);"
)
end
@matisnape
matisnape / 20191103_scrapeCreditCardHistory.js
Last active December 25, 2019 14:57
scrape credit card transactions from mbank
/*
Disclaimers:
1. The script works for currently loaded transactions, so make sure to set the correct date range.
2. Supports only credit card history and only transactions that are already booked.
3. No data is saved by the script to third party locations
*/
class CreditHistoryScraper {
transactions() {
function getElementByXpath(path) {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
@matisnape
matisnape / script.js
Last active March 10, 2018 15:41
Get sum of PEKA tickets value
# tPortmonetka - przejazdy
# range of positions: position() >= 100 and not(position() > 200)
# get last column
let cost_col = $x("//*[@id='dataTable']//tr[position() >= 100 and not(position() > 200)]/td[last()]/div");
# parse to float
let float_cost_col = cost_col.map(el => parseFloat(el.innerText.replace(',', '.')));
# sum
@matisnape
matisnape / example.js
Last active January 16, 2018 11:09
Postman snippets
// date format 2014-12-21T11:32:26.341Z
date = new Date().toISOString();
postman.setEnvironmentVariable("date", date);
// timestamp example: 1515684365
let randomized = Math.floor(Date.now() / 1000);
postman.setEnvironmentVariable("randomized", randomized);
// past date
date = new Date();
@matisnape
matisnape / Free O'Reilly Books.md
Created October 10, 2016 20:00 — forked from augbog/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@matisnape
matisnape / es6.js
Created August 5, 2016 17:51
Protractor
"use strict";
var Page = require('../Page')
var Fragment = require('../Fragment')
class LoginPage extends Page {
constructor() {
super('/login');
this.emailField = $('input.email');
this.passwordField = $('input.password');
@matisnape
matisnape / Selenium Cheat Sheet.md
Created October 30, 2015 10:07 — forked from kenrett/Selenium Cheat Sheet.md
Selenium Cheat Sheet - Ruby

#Getting Started

##Webpage:

<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">
require 'rails_helper'
feature "Business Search", js: true do
let(:user) { create :user }
let!(:business) { create :business, name: "Some Business" }
let!(:business2) { create :business, name: "The other Business" }
let(:businesses_page) { BusinessesPage.new }
let(:app) { App.new }
let(:search_field) { businesses_page.business_search }
let(:biz_container) { businesses_page.main.root_element }