Skip to content

Instantly share code, notes, and snippets.

View virtualadrian's full-sized avatar
🤓
Geek: A knowledgeable and obsessive enthusiast.

VirtualAdrian virtualadrian

🤓
Geek: A knowledgeable and obsessive enthusiast.
View GitHub Profile
@virtualadrian
virtualadrian / kick.sh
Created September 27, 2017 10:11 — forked from Miciah/kick.sh
OpenShift kickstart script (using beta packages)
#!/bin/sh
set -e
if [ $# -lt 1 ]
then
printf 'Usage: %s vm_name [arg1 [arg2 [...]]]\n' "$0"
printf 'Example:\n'
printf '%s my_new_broker_and_node install_components=broker,node,activemq,datastore named_ip_addr=10.0.0.1' "$0"
exit 1
@virtualadrian
virtualadrian / serverless.yml
Created September 22, 2017 09:32 — forked from bytekast/serverless.yml
Serverless with Spring Boot / Spring Data
service: springboot-lambda
provider:
name: aws
runtime: java8
memorySize: 1536
timeout: 60
package:
artifact: build/distributions/springboot-lambda.zip
@virtualadrian
virtualadrian / GetJSON.sql
Created September 18, 2017 21:48 — forked from DeepInTheCode/GetJSON.sql
SQL table to JSON Object
/****** Object: StoredProcedure [dbo].[GetJSON] Script Date: 5/28/2013 4:31:01 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[GetJSON]
(
@table_name varchar(50),
@virtualadrian
virtualadrian / app-koa.js
Created September 17, 2017 19:19 — forked from Unitech/app-koa.js
Node.js Load Balancers Benchmark: HAProxy vs Nginx vs PM2
const Koa = require('koa');
const app = new Koa();
app.use(ctx => {
ctx.body = 'Hello World';
});
var listener = app.listen(process.env.PORT || 3000, () => {
console.log(`Listening on port ${listener.address().port}`);
});
@virtualadrian
virtualadrian / git-branch-simplify.md
Created August 23, 2017 23:24
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@virtualadrian
virtualadrian / git-branch-simplify.md
Created August 23, 2017 23:24
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@virtualadrian
virtualadrian / install.sh
Created August 20, 2017 09:23 — forked from rodrigoslayertech/install.sh
Open LiteSpeed One Click Installation for non-root users v1.0
#!/bin/bash
##############################################################################
# Open LiteSpeed is an open source HTTP server. #
# Copyright (C) 2013 - 2017 LiteSpeed Technologies, Inc. #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
@virtualadrian
virtualadrian / install.sh
Created August 20, 2017 09:23 — forked from rodrigoslayertech/install.sh
Open LiteSpeed One Click Installation for non-root users v1.0
#!/bin/bash
##############################################################################
# Open LiteSpeed is an open source HTTP server. #
# Copyright (C) 2013 - 2017 LiteSpeed Technologies, Inc. #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
#!/bin/bash
apt-get update
apt-get install -y \
bison \
autoconf \
build-essential \
pkg-config \
git-core \
@virtualadrian
virtualadrian / gmaps.js
Created August 1, 2017 00:03 — forked from cvan/gmaps.js
Google Maps multiple destinations sorted by shortest path
require('es6-promise').polyfill();
var request = require('request');
const API_KEY = process.env.GOOGLE_MAPS_API_KEY || '';
var places = [
'steins, mountain view, CA',
'st. stephens green, mountain view, CA',