Skip to content

Instantly share code, notes, and snippets.

@deeja
deeja / Program.cs
Last active May 27, 2020 10:33
UdpClient for local data receive - Works on dotnet core
internal class Program
{
private const int PORT = 4843;
private static void Main(string[] args)
{
Console.WriteLine("Packet Forwarding UP!");
var client = new UdpClient(PORT);
var ipEndPoint = new IPEndPoint(IPAddress.Loopback, PORT);
while (true)
@deeja
deeja / nuxt-layout-full-height.vue
Created May 25, 2020 14:52
Full height Nuxt.js layout hack
<style>
div#__nuxt,
#__layout,
#__layout > div,
#app {
min-height: 100vh;
}
</style>
@deeja
deeja / MyRecaptchaForm.vue
Created May 21, 2020 16:00
recaptcha V3 Vue or Nuxt
<template>
<div>
<form @submit.prevent="sendMessage" method="post">
<button type="submit">Send</button>
</form>
</div>
</template>
<script>
export default {
mounted() {
@deeja
deeja / Breed.js
Last active May 9, 2020 15:36
Node.js - Sequelize Model Setup
const { DataTypes } = require("sequelize");
module.exports = {
name: "Breed",
modelName: "breed",
schema: {
name: {
type: DataTypes.STRING,
allowNull: false,
}
@deeja
deeja / Dockerfile
Created May 6, 2020 15:44
Dockerfile - Nuxt.js Generate - Nginx Serve
FROM node:alpine as builder
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn
COPY . ./
RUN yarn generate
FROM nginx
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
@deeja
deeja / README
Last active June 21, 2022 23:31
Kubernetes Dashboard on Docker for Windows
## Instructions
https://collabnix.com/kubernetes-dashboard-on-docker-desktop-for-windows-2-0-0-3-in-2-minutes/
## Dashboard URL
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=default
@deeja
deeja / Example.vue
Last active August 2, 2020 09:42
Lazy loading image component for Nuxt.js
<template>
<div>
<!-- Properties automatically map -->
<LazyImage class="my-class" src="/some/asset.png" alt="" />
<!-- Can use property and event binding -->
<LazyImage class="my-class" :src="transform(myObj.imageSrc)" :alt="myObj.alt" @click="showMessage" />
</div>
</template>
@deeja
deeja / pages.json
Last active May 5, 2020 11:28
The content that generates the site danbl.com [Obsolete - Site now uses storyblok CMS]
[
{
"name":"About Me",
"slug":"",
"components":[
{
"type":"TextCard",
"content":"### Senior C# Developer\n\n I've been programming since the early 2000's, and almost all my projects have involved C# in some capacity. - Asp.NET (Forms, MVC, WebAPI) - .NET Standard / Core"
},
{
@deeja
deeja / Precompile.bat
Created October 18, 2019 17:19
Precompile Views using AspNet compiler
C:\windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -c -p C:\dev\src\Website\Website\code\obj\Release\Aspnet
CompileMerge\Source -u C:\dev\src\Website\Website\code\obj\Release\AspnetCompileMerge\TempBuildDir
@deeja
deeja / AWS-Iot-Blinkt.py
Created October 16, 2019 22:46
AWS IoT pushing through led colours on the Pi Zero Blinkt
# Need to set the policies for the subscribe and client ID within AWS
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
import logging
import time
import argparse
import json
# > pip install blinkt
import blinkt