Skip to content

Instantly share code, notes, and snippets.

View DominicFinn's full-sized avatar
💭
Whirring away

Dominic Finn DominicFinn

💭
Whirring away
View GitHub Profile
@DominicFinn
DominicFinn / killing_rats_1.md
Created April 28, 2025 13:31
Tasks for Connor

Killing rats

So, when you first start learning how to code, it's a little bit boring. Essentially that's tough luck. Soz. You have to learn the basics first sadly.

BUT. Think of this as grinding. Grind to get the EXP to continue your journey. Learning to program is better than doing boring jobs so.... 🤷🏻‍♂️

After you've followed some of the basics, we can quit the tutorial and start the basic missions. Here's some tasks to see what you have learned. If you can't do them, it doesn't matter. Get to where you can first then try and Google the answers. Basically, trying to work out how the hell you do something is part of the fun.

Basic tasks

@DominicFinn
DominicFinn / signal_strength.py
Last active April 19, 2024 12:30
Signal Strength Logging on Mac
import subprocess
import time
def get_wifi_rssi():
# Command to get WiFi details, you can just call this actually if you want all the deets. system_profiler SPAirPortDataType
command = ["system_profiler", "SPAirPortDataType"]
# Executing the command with all outputs suppressed, otherwise it'll output it in the terminal still
result = subprocess.run(
@DominicFinn
DominicFinn / onProspectingStudentCreated.js
Created March 28, 2023 11:53
Event handlers handling fire store documents create / updated
const functions = require("firebase-functions");
const IterableDataService = require('../../iterable/IterableDataService');
module.exports = functions.firestore.document('prospecting-student/{email}').onCreate(async (snap, context) => {
const student = snap.data();
const result = await IterableDataService.putUserData({
email: snap.id,
userId: student.uuid,
dataFields: {
@DominicFinn
DominicFinn / index.js
Last active March 28, 2023 11:52
Different behaviour for different firebase functions
const functions = require("firebase-functions");
const express = require("express");
let staticValue = { message: 'Hello World!' }
// you don't want this then as it will be a single instance of helloWorld_app. You don't really have control when the instance is up or down unless
// you configure that in the function with "minInstances" etc
const app = express();
app.get('/short', (req, res) => {
@DominicFinn
DominicFinn / escrow.sol
Created February 28, 2022 21:52
Escrow contract
pragma solidity ^0.5.2;
contract Escrow {
// the person who will pay the funds
address public payer;
// the person who will recieve funds
address public payee;
// the lawyer / solicitor, controller of the funds
@DominicFinn
DominicFinn / index.html
Created January 25, 2021 14:55
YouTube / Vimeo Parallax
<div class="jarallax" data-jarallax data-jarallax-video="https://www.youtube.com/watch?v=F3I0wRGAkxo">
<div class="demo-table">
<div class="demo-table-cell">
<h1>Just Another Parallax <small>[Jarallax]</small></h1>
<h2>Background Video Parallax (YouTube &amp; Vimeo)</h2>
<br>
<a class="github-button" href="https://github.com/nk-o/jarallax" data-style="mega" data-count-href="/nk-o/jarallax/stargazers" data-count-api="/repos/nk-o/jarallax#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star nk-o/jarallax on GitHub">Star</a>
<a class="github-button" href="https://github.com/nk-o/jarallax/archive/master.zip" data-style="mega" aria-label="Download nk-o/jarallax on GitHub">Download</a>
</div>
docker-compose up
using System;
using System.Collections.Generic;
namespace ResultThings
{
internal class Result
{
public bool Success { get; }
@DominicFinn
DominicFinn / GoogleCalendarObjects_Users.cs
Created April 22, 2020 16:38
The various User classes taken from the Google APIs helper lib. Kind of a picking list as the majority is just noise
/// <summary>JSON template for User object in Directory API.</summary>
public class User : Google.Apis.Requests.IDirectResponseSchema
{
[Newtonsoft.Json.JsonPropertyAttribute("addresses")]
public virtual System.Collections.Generic.IList<UserAddress> Addresses { get; set; }
/// <summary>Indicates if user has agreed to terms (Read-only)</summary>
[Newtonsoft.Json.JsonPropertyAttribute("agreedToTerms")]
public virtual System.Nullable<bool> AgreedToTerms { get; set; }
@DominicFinn
DominicFinn / DeepViewModel.cs
Last active April 21, 2020 14:49
Avoid this
using System;
namespace DeepObjects.Models
{
internal enum CatStatus
{
Outstanding
}
internal sealed class CatDetails