This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To use this you need to | |
// 1) Download and enable Basic Auth plugin: https://github.com/WP-API/Basic-Auth | |
// 2) Install dependencies: "npm i csv-parse wpapi" | |
const fs = require('fs'); | |
const WPAPI = require('wpapi'); | |
const parse = require("csv-parse/lib/es5"); | |
const PASSWORD = process.env.PASSWORD || ""; | |
const wp = new WPAPI({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script installs the dependencies required by cypress.io tool | |
# on amazon linux AMI as the required dependencies are not easily available. | |
# e.g., NODE_MODULES_PATH="/home/ec2-user/cypress-example-kitchensink/node_modules" | |
NODE_MODULES_PATH="{{PLACE_YOUR_NODE_MODULES_PATH_HERE}}" | |
CYPRESS_DIST_DIR="$NODE_MODULES_PATH/cypress/dist/Cypress" | |
exitError() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Requirements: | |
# brew install jq | |
# | |
# Launch: | |
# Executing script will print environment variables (eg "~/src/assume-role.sh 983056893078 OrganizationAccountAccessRole master") | |
# Use "." in bash if you want to export them to a current session | |
# (eg: . ~/src/assume-role.sh 12312312313 OrganizationAccountAccessRole master) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Kafka utilises JMX to provide an access to some useful data | |
# This script uses command line JMX client to retrieve those metrics from a Kafka broker | |
# and publish them to AWS Cloudwatch | |
# JMX Client: http://crawler.archive.org/cmdline-jmxclient/downloads.html | |
# Runtime dependencies: Java, AWS CLI, IAM role attached to the instance with permissions | |
# to put Cloudwatch metrics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ENVIRONMENT="{{ target_env }}" # Ansible will replace this one | |
AWS_SERVICE_LOG_GROUP="{{ kafka_log_group_name }}" # Ansible will replace this one (automatically discovered) | |
AWS_SERVICE_LOG_STREAM=container-logs | |
DOCKER_CONTAINER="{{ kafka_docker_container }}" # Ansible will replace this one | |
# Get meta information about instance and its placement | |
AVAILABILITY_ZONE=`curl http://169.254.169.254/latest/meta-data/placement/availability-zone` | |
LOCAL_IP=`curl -s http://169.254.169.254/latest/meta-data/local-ipv4` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DISPLAY=:99 | |
/etc/init.d/xvfb start | |
# do your selenium tests here | |
/etc/init.d/xvfb stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Basic directive | |
// =================================================================================================== | |
class BasicDirective { | |
constructor(moduleName) { | |
this.moduleName = moduleName; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BasicDirective { | |
constructor(link, controller) { | |
if (typeof link !== 'undefined') this.link = link; | |
if (typeof controller !== 'undefined') this.controller = controller; | |
} | |
getClassName() { | |
var str = this.constructor.toString(); | |
str = str.substr('function '.length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path='../_all.ts' /> | |
module App | |
{ | |
'use strict'; | |
import ICurrentPosition = App.Services.ICurrentPosition; | |
export class MapCtrl extends App.Controllers.Basic | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> |
NewerOlder