Skip to content

Instantly share code, notes, and snippets.

View gormster's full-sized avatar

Morgan Harris gormster

View GitHub Profile
@gormster
gormster / Logic Apps Template.json
Last active May 20, 2020 00:34
Power Automate/Logic Apps - Split String to Characters
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppName": {
"type": "String",
"metadata": {
"description": "Name of the logic app."
}
},
@gormster
gormster / behat_example_plugin.php
Created July 1, 2019 03:58
Behat - pause on step failure
// Replace with your favourite way of requiring a file.
require_once(__DIR__ . '/../../../../lib/behat/behat_base.php');
use Behat\Behat\Hook\Scope\AfterStepScope;
use Behat\Testwork\Tester\Result\TestResult;
// Uncomment this line to enable the debug step.
// define('DEBUG',1);
// Make sure to rename this class (and the file!) with your plugin's namespace.
# coding: utf-8
import itertools
stars = [complex(x,y) for x,y in itertools.product(range(11),range(5)) if (x + y) % 2 == 0]
def print_flag(s):
lines = []
for y in range(5):
line = []
@gormster
gormster / guinspect.py
Created November 5, 2015 02:35
Inspect your python classes and methods in a variety of GUI text editors
def inspect_in(o, call):
import inspect
import subprocess
_, line = inspect.getsourcelines(o)
f = inspect.getsourcefile(o)
subprocess.call([x.format(filename=f, line=line) for x in call])
def subl(o):
inspect_in(o, ['subl', '{filename}:{line}'])
@gormster
gormster / MinecraftEnableYosemite.command
Last active August 29, 2015 14:14
Enable the Minecraft Launcher in OS X Yosemite
echo "This assumes you have Minecraft installed at /Applications/Minecraft.app"
cat << 'EOF' > /Applications/Minecraft.app/Contents/MacOS/Minecraft
#!/bin/sh
PRG=$0
while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
[
{
"address": "284 Gower Street\nPreston 3072",
"badge": "Home Brewer",
"dates": "18th May, 1:00pm - 4:00pm",
"img": "/thumb/?src=../uploads/event/homemade_festival-5312.jpg&w=210&h=150&q=90",
"link": "/events/view/34",
"tickets": "FREE ENTRY",
"title": "Darebin Homemade Food and Wine Festival",
"url": "http://www.darebin.vic.gov.au/festivals",
@gormster
gormster / gbw.json
Created March 20, 2013 03:49
Entire GBS calendar in JSON format, scraped from the website. If there's problems with it, file a pull request or let me know @mcgorgomagan.
[
{
"address": "284 Gower Street\nPreston 3072",
"badge": "Home Brewer",
"dates": "18th May, 1:00pm - 4:00pm",
"img": "/thumb/?src=../uploads/event/homemade_festival-5312.jpg&w=210&h=150&q=90",
"link": "/events/view/34",
"tickets": "FREE ENTRY",
"title": "Darebin Homemade Food and Wine Festival",
"url": "http://www.darebin.vic.gov.au/festivals",
@gormster
gormster / gbw.json
Last active December 15, 2015 04:29
Entire GBW calendar in JSON format. Scraped from the website so it might be a little glitchy - send corrections to @mcgorgomagan or make a pull request.
[
{
"address": "284 Gower Street\nPreston 3072",
"badge": "Home Brewer",
"dates": "18th May, 1:00pm - 4:00pm",
"img": "/thumb/?src=../uploads/event/homemade_festival-5312.jpg&w=210&h=150&q=90",
"link": "/events/view/34",
"tickets": "FREE ENTRY",
"title": "Darebin Homemade Food and Wine Festival",
"url": "http://www.darebin.vic.gov.au/festivals",