Skip to content

Instantly share code, notes, and snippets.

View m-x-k's full-sized avatar

Martin Kelly m-x-k

View GitHub Profile
@m-x-k
m-x-k / ExampleJShell.java
Created December 31, 2017 17:18
Custom JShell Implementation
import java.io.ByteArrayInputStream;
import java.io.Console;
import java.util.List;
import jdk.jshell.*;
import jdk.jshell.Snippet.Status;
class ExampleJShell {
public static void main(String[] args) {
Console console = System.console();
try (JShell js = JShell.create()) {
@m-x-k
m-x-k / jshellAliasMacOS.sh
Created December 30, 2017 18:47
JShell Alias MacOS
#!/bin/bash
echo "Add the following to your ~/.bashrc file and run 'source ~/.bashrc'"
alias jshell=`echo $(/usr/libexec/java_home)`/bin/jshell
@m-x-k
m-x-k / installMiniShiftMacOS.sh
Created December 25, 2017 13:41
Install MiniShift on MacOS
#!/bin/bash
echo "Install MiniShift on MacOS: "
echo " Note: assumes machine not pre-setup with prerequisites!!!"
brew update
echo "Install Homebrew Casks:"
brew install caskroom/cask/brew-cask
@m-x-k
m-x-k / setup-pip.py
Created December 22, 2017 07:49
PIP artifactory configuration
import os
import argparse
# Constants
PIP_HOST = "artifactory.my.domain.com"
PIP_URL = "http://%s/artifactory/api/pypi" % PIP_HOST
def setup_pypric(args):
fullpath = "%s/.pypirc" % args.userhome
@m-x-k
m-x-k / gist:35365758fd090cc5781a342a7dab2727
Created December 3, 2017 18:54
OpenShift not resolving hostnames nip.io
nip.io supports the use of wildcards when setting host ip addresses (e.g. *.nip.io)
Some routers do not support DNS for nip.io support. To fix set 8.8.8.8 and 8.8.4.4 as your DNS entry.
@m-x-k
m-x-k / PYTHON_RESOURCES.md
Last active April 8, 2018 02:14
List of python resource websites

When it comes to python development it can be difficult to know which websites to focus on for the best up-to-date information. Below is a list of go-to websites for all the latest and greatest python information:

Finding resources/tips

Awesome Python

Python Guide

Python Module of the Week

@m-x-k
m-x-k / revealExample.html
Last active April 8, 2018 02:14
reveal.js example slides
<!-- -*- indent-tabs-mode:t; -*- -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Reveal Example Slides</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" href="./reveal.js/css/reveal.css"/>
<link rel="stylesheet" href="./reveal.js/css/theme/night.css" id="theme"/>
</head>
@m-x-k
m-x-k / jenkinsJobConsoleOutput.py
Last active January 5, 2024 08:37
Python script to help get jenkins job console output
#!/usr/bin/env python
import re
import argparse
import requests
jenkins_url = "https://localhost:8080"
# Add new jobs here:
jobs = {
@m-x-k
m-x-k / StepsToSetupArtifactoryWithNpm
Last active December 3, 2022 04:51
Setting up JFrog artifactory for NPM
docker pull docker.bintray.io/jfrog/artifactory-oss:latest
docker run --name artifactory -d -p 8081:8081 docker.bintray.io/jfrog/artifactory-oss
# In browser open http://localhost:8081 and follow basic steps
# Add new remote repository: http://localhost:8081/artifactory/webapp/#/admin/repositories/remote
# URL: https://registry.npmjs.org
# RepositoryLayout: NPM default
# Add new virtual repository of type "Generic" using remote repository above
@m-x-k
m-x-k / restEndointMethodResponseExample.go
Created September 5, 2017 20:33
Golang http request method alternative response
package main
import "net/http"
func main() {
mainMux := http.NewServeMux()
mainMux.HandleFunc("/speak", func(res http.ResponseWriter, req *http.Request) {
if req.Method == "GET" {
res.Write([]byte("Hello, World!\n"))