Skip to content

Instantly share code, notes, and snippets.

View marcodejongh's full-sized avatar

Marco de Jongh marcodejongh

  • Atlassian
  • Sydney
View GitHub Profile
/*
Keeps checking the spirit of tasmania booking page for new available ferries.
I run this script in the chrome developer tools console with this page open:
https://www.spiritoftasmania.com.au/my-booking#?booking=XXXXX&lastname=YYYYY&step=ReturnFare&version=2
To open chrome devtools press: Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux) then click the console tab.
You need to be on the page because of browser security policies, but technically these requests dont require a browser env
and could also be run in a nodejs script.
http {
proxy_cache_path /tmp/nginx/cache
levels=1:2
keys_zone=main:10m
max_size=1g inactive=1d;
proxy_temp_path /tmp/nginx/tmp;
server {
listen 80;
server_name app.example.com;
const execSync = require("child_process").execSync;
const writeFileSync = require("fs").writeFileSync;
const resolve = require("path").resolve;
function getDependencyInfo(dependency) {
return JSON.parse(execSync(`yarn info --json ${dependency}`));
}
/**
upgradeCommonDependencies is only needed when using this script for dependencies shipped from the
const execSync = require("child_process").execSync;
const writeFileSync = require("fs").writeFileSync;
const resolve = require("path").resolve;
function getLatestDependencyVersion(dependency) {
return JSON.parse(execSync(`yarn info --json ${dependency}`)).data.version;
}
const packageJsonPath = resolve(process.cwd(), "./package.json");
console.log("Updating editor-core");
function clickNextEntry() {
$('[title="AUS_ Hours Worked | 7.6 Hours | Approved"]').click()
}
function selectNewFeatures() {
}
npm run lint | grep '.*/partofpath/.*' | while read -r line ; do
echo "Processing $line"
# your code goes here
lebab --replace $line --transform args-rest
done
@marcodejongh
marcodejongh / MyView.java
Created November 26, 2013 10:38
Example for using senbot pagerepresentation classes
package com.gfk.echo.senbot.cucumber.views;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;
public class MyView {
@FindBy(how = How.ID, using = "WhateverID")
public WebElement someElement;
}
class SomeClass {
constructor() {
this.x = 0;
}
getX() {
return this.x;
}
setX(val) {
this.x = val;
}
Context = {
name: 'pablo',
dogs: [
{
name: 'Fikkie'
},
{
name: 'Jantje'
}
],
1. Everything is tamas' fault
2. If in doubt revert to rule 1