Skip to content

Instantly share code, notes, and snippets.

View jrichardsz's full-sized avatar

JRichardsz jrichardsz

View GitHub Profile
@jrichardsz
jrichardsz / visual code vs snippets.md
Created September 12, 2024 16:34
visual code vs snippets

select regex results

alt+enter

@jrichardsz
jrichardsz / mobile dimensions snippets.md
Last active August 23, 2024 04:50
mobile dimensions snippets
@jrichardsz
jrichardsz / nodejs socketio socket.io snippets - helloworld.js
Created August 17, 2024 13:43
nodejs socketio socket.io snippets
const express = require('express');
const fs = require('fs')
const path = require('path')
const app = express()
const server = require('http').Server(app)
const io = require('socket.io')(server,{maxHttpBufferSize: 1e7})
io.on('connection', function (socket) {
console.log("headers at connection:")
console.log(socket.handshake.headers)
@jrichardsz
jrichardsz / csharp c# crud - mysql.md
Created August 4, 2024 23:48
csharp c# crud - mysql

Select

// dotnet add package MySql.Data --version 9.0.0

using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@jrichardsz
jrichardsz / ReadEventsFromPartitionAsync.cs
Last active August 13, 2024 20:45
azure event hub snippets
EventHubConsumerClient consumerClient = new EventHubConsumerClient(consumerGroup, connectionString, eventHubName);
string firstPartition = (await consumerClient.GetPartitionIdsAsync()).First();
PartitionProperties properties = await consumerClient.GetPartitionPropertiesAsync(firstPartition);
logger.LogInformation(""+properties.LastEnqueuedTime);
EventPosition startingPosition = EventPosition.FromSequenceNumber(properties.LastEnqueuedSequenceNumber);
logger.LogInformation($"startingPosition: {startingPosition}");
await foreach (PartitionEvent partitionEvent in consumerClient.ReadEventsFromPartitionAsync(firstPartition, startingPosition))
{
string text = Encoding.UTF8.GetString(partitionEvent.Data.Body.ToArray());
@jrichardsz
jrichardsz / how to organize flow diagrams in a portal.md
Created July 19, 2024 15:04
how to organize flow diagrams in a portal

create-a-dashboard

DROP table IF EXISTS [t1];
CREATE TABLE t1 (
    id int IDENTITY(1,1) NOT NULL,
    c1 int DEFAULT 0,
    c2 int DEFAULT 0,
    c3 int DEFAULT 0
);

DROP table IF EXISTS [t1_history];