Skip to content

Instantly share code, notes, and snippets.

Michael Powers swedishborgie

Block or report user

Report or block swedishborgie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@swedishborgie
swedishborgie / compile.sh
Created Apr 16, 2019
protoc-gen-micro issue 42 clarification
View compile.sh
#!/bin/sh
protoc -I. --micro_out=. my.srv.opps/proto/opps.proto
protoc -I. --micro_out=. my.another.srv.opps/proto/opps.proto
@swedishborgie
swedishborgie / messages.proto
Last active Feb 27, 2019
protoc-gen-micro issue #12 example
View messages.proto
syntax = "proto3";
option go_package = "myservice";
message MyMessage {
uint32 id = 1;
}
@swedishborgie
swedishborgie / example.go
Created Jan 2, 2019
Micro go-config issue example
View example.go
package main
import (
"io/ioutil"
"log"
"time"
config "github.com/micro/go-config"
)
@swedishborgie
swedishborgie / fix-mdl.js
Created Oct 19, 2018
Helper function to re-calculate input styles for Material Design Lite
View fix-mdl.js
function fixMdlFields(element, validate) {
element.querySelectorAll("input, textarea").forEach((el) => {
let parentClasses = el.parentNode.classList;
if (el.disabled) {
parentClasses.add("is-disabled");
} else {
parentClasses.remove("is-disabled");
}
if (el.readOnly) {
parentClasses.add("is-readonly");
@swedishborgie
swedishborgie / Main.java
Created Jul 27, 2018
Reproducing Copy-Paste issue from Firefox to Java on Ubuntu
View Main.java
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.*;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.util.Arrays;
import java.util.Optional;
public class Main {
View postgres-10-notify-in-logical-replication-trigger.sql
--On Master
CREATE TABLE test (id SERIAL PRIMARY KEY, msg TEXT NOT NULL);
CREATE PUBLICATION testpub FOR TABLE test
--On Replica
CREATE TABLE test (id SERIAL PRIMARY KEY, msg TEXT NOT NULL);
CREATE SUBSCRIPTION testsub CONNECTION 'host=<host> user=<user> password=<test>' PUBLICATION testpub;
CREATE OR REPLACE FUNCTION notify_channel() RETURNS trigger AS $$
BEGIN
RAISE LOG 'Notify Triggered';
You can’t perform that action at this time.