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.
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
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
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
Vagrant.configure("2") do |config|
config.vm.box = "trusty"
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/trusty-server-cloudimg-amd64-juju-vagrant-disk1.box"
# we’ll forward the port 8000 from the VM to the port 8000 on the host (OS X)
config.vm.network :forwarded_port, host: 8000, guest: 8000
#config.vm.synced_folder("vagrant-docker", "/vagrant")
config.vm.provider :virtualbox do |vb|
# vb.gui = true