Skip to content

Instantly share code, notes, and snippets.

View dwelch2344's full-sized avatar

David Welch dwelch2344

View GitHub Profile
@dwelch2344
dwelch2344 / kafka-consumer.test.js
Created October 2, 2018 20:05
kafka avro nodejs example
const registryUrl = 'http://schema-registry:8081'
const avro = require('avsc')
const registry = require('avro-schema-registry')(registryUrl)
const kafka = require('kafka-node')
const client = new kafka.KafkaClient({ kafkaHost: 'kafka:9092' })
const topic = {
topic: 'actor7',
offset: 3695
@dwelch2344
dwelch2344 / keybase_anonymous_encrypt.sh
Created September 5, 2018 07:22
keybase anonymous encrypt
keybase encrypt --auth-type=anonymous --no-self-encrypt -m hi welch
@dwelch2344
dwelch2344 / keybase_anonymous_encrypt.sh
Created September 5, 2018 07:22
keybase anonymous encrypt
keybase encrypt --auth-type=anonymous --no-self-encrypt -m hi welch
@dwelch2344
dwelch2344 / webhook-all-the-things.sql
Created June 5, 2018 03:21
wordpress-sucks-queries
('active', 'Dummy Webhook', 1, 'http://requestbin.fullcontact.com/<token>', 'asdf', 'coupon.created', '2018-06-05 03:11:09', '2018-06-05 03:11:09', '0000-00-00 00:00:00', '0000-00-00 00:00:00', -1, 0, 1),
('active', 'Dummy Webhook', 1, 'http://requestbin.fullcontact.com/<token>', 'asdf', 'coupon.updated', '2018-06-05 03:11:09', '2018-06-05 03:11:09', '0000-00-00 00:00:00', '0000-00-00 00:00:00', -1, 0, 1),
('active', 'Dummy Webhook', 1, 'http://requestbin.fullcontact.com/<token>', 'asdf', 'coupon.deleted', '2018-06-05 03:11:09', '2018-06-05 03:11:09', '0000-00-00 00:00:00', '0000-00-00 00:00:00', -1, 0, 1),
('active', 'Dummy Webhook', 1, 'http://requestbin.fullcontact.com/<token>', 'asdf', 'customer.created', '2018-06-05 03:11:09', '2018-06-05 03:11:09', '0000-00-00 00:00:00', '0000-00-00 00:00:00', -1, 0, 1),
('active', 'Dummy Webhook', 1, 'http://requestbin.fullcontact.com/<token>', 'asdf', 'customer.updated', '2018-06-05 03:11:09', '2018-06-05 03:11:09', '0000-00-00 00:00:00', '0000-00-00 00:00:00', -1, 0,
heartbeat=
ribbon=
port=8500
auto-registration=
config.enabled=false
cloud=
ribbon.client.name=application2
service-registry=
enabled=true
discovery=
package com.lightbend.akka.sample
import java.net.InetAddress
import akka.http.scaladsl.testkit.ScalatestRouteTest
import com.ecwid.consul.v1.ConsulClient
import com.netflix.client.config.IClientConfig
import com.netflix.loadbalancer.{Server, ServerList}
import org.scalatest._
import org.springframework.beans.factory.annotation.Value
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: some-service
labels:
k8s-app: some-service
spec:
replicas: 1
template:
{
"name": "foobar",
"version": "1.1.0",
"description": "A Node.js starter for the Serverless Framework with async/await and unit test support",
"main": "handler.js",
"scripts": {
"test": "jest",
"debug": "node --inspect ./node_modules/.bin/serverless offline -s dev"
},
"author": "",
module.exports.example = (event, context, callback) => {
var Client = require('pg').Client
var pg2 = new Client({
connectionString: process.env.dbUrl
})
console.log('client')
pg2.connect()
console.log('connect')
pg2.query('SELECT NOW()', (err, res) => {
g.
addV('shape').property('name', 'A').as('A').
addV('shape').property('name', 'B').as('B').
addV('shape').property('name', 'C').as('C').
addV('shape').property('name', 'D').as('D').
addV('shape').property('name', 'E').as('E').
addV('shape').property('name', 'F').as('F').
addV('shape').property('name', 'G').as('G').
addV('shape').property('name', 'H').as('H').