Skip to content

Instantly share code, notes, and snippets.

@deeja
deeja / amplify_shim.graphql
Last active November 29, 2023 00:07
Amplify GraphQL -> C# Code Generation using `graphql-codegen`
# Taken from https://github.com/dotansimha/graphql-code-generator/discussions/4311
scalar AWSTime
scalar AWSDate
scalar AWSDateTime
scalar AWSTimestamp
scalar AWSEmail
scalar AWSJSON
scalar AWSURL
scalar AWSPhone
@deeja
deeja / .gitConfig
Created February 4, 2021 10:49
Conditional Git Configuration on Windows
# Config in MY_WORK_DIRECTORY
[user]
name = "Work user"
email = email@mywork.co.uk
@deeja
deeja / RapsberryPi-Bluetooth-SSH-ConnectFromWindows.md
Created October 7, 2019 20:59
The second part of connecting to SSH using bluetooth (from windows)

Copied from https://www.instructables.com/id/Raspberry-Pi-Bluetooth-to-PuTTY-on-Windows-10/ First part: https://gist.github.com/deeja/83f50fb893383ba328e06769a1e6d44d

Step 1: Configure Raspberry Pi for Bluetooth.

First configure you Raspberry Pi for Bluetooth shell access, by following the directions in Patrick Hundal's article Headless Raspberry Pi configuration over Bluetooth.

Notes on this process:

As an alternative to SD Card pre-configuration, the method I used was to enable the Pi's serial port, login using the PuTTY terminal program via a USB to serial converter, and configure the Pi's system whilst it ran on the target hardware. There are many other instructional articles available on this topic.

@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 / 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 / network-manager-raspbian-2020-02-05.md
Created April 21, 2022 07:26 — forked from jjsanderson/network-manager-raspbian-2020-02-05.md
Installing Network Manager on Raspbian 2020-02-05

Installing Network Manager on Raspbian 2020-02-05

NOTE:
This guide was written two years ago, which in Pi years means it's now graduated college, or something. Inevitably, it's at least a little out of date, and it may even be entirely misleading. There are several helpful suggestions in the comments (thanks everyone), and most recently a report that what's here plain doesn't work on current (early 2022) Raspbian. Which isn't even called 'Raspbian' any more.
As of Jan 2022 I'm partially back in my office-which-has-access-to-eduroam, and I do have a need to build up a fresh Pi desktop. If and when I get that working I'll update this guide. In the meantime: good luck, and please leave a comment to report success or failure.

Default Raspbian is not able to connect to wifi networks using corporate security setups, including eduroam. However, the issue is that the packaged networking control widget does not expose the relevant security features, rather than any underlying hardware limitation. The sol

@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 / VINValidator.cs
Created February 14, 2018 13:38
VIN validator C#
//Algorithm taken from the wikipedia page https://en.wikipedia.org/wiki/Vehicle_identification_number#Check-digit_calculation
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string vin = "1VWBP7A37DC046870";
@deeja
deeja / CreateElasticSearchDataStreamTest.cs
Last active March 30, 2021 16:46
Create a data stream index template using NEST for Elastic Search
using System;
using Elasticsearch.Net;
using Nest;
using NUnit.Framework;
public class CreateDataStreamTest
{
[Test]
public void ShouldCreateDataStreamTemplate()
{
@deeja
deeja / Program.cs
Created March 22, 2021 18:20
Kestrel self hosting .net core 3.1
private static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.UseKestrel((context, options) =>
{