Skip to content

Instantly share code, notes, and snippets.

@tyndyll
tyndyll / Filament Holder for 3D Printers for Laser Cutting.md
Last active July 12, 2021 10:05
Filament Holder for 3D Printers for Laser Cutting

I had a whoopsie and broke the supplied filament holder for my Anycubic 3D printer. Rather than spending the money I took advantage of my Farset Labs membership and some scrap MDF I had lying around. The design was created to use materials 6mm thick. You will require 2 of each SVG

If you want the original model it is available at Tinkercad

NOTE: A support for the filament itself is not included. I just use a pencil

@tyndyll
tyndyll / test_urls.py
Created February 20, 2020 14:17
Test Django URL Resolves to Correct CBV
from django.test import TestCase
from django.urls import resolve
from .views import Home
class TestURLPatterns(TestCase):
def test_home_path_calls_home_view(self):
found = resolve("/")
self.assertEqual(found.func.view_class, Home)
@tyndyll
tyndyll / README.md
Created April 23, 2019 17:00
English Premier League Table Viewer

English Premier League Table Viewer

Abstract

This is a simple implementation of a problem presented in a conversation that arose about hiring questions that I was nerdsniped on. This is just a basic textual output instead of the requested HTML output, but that could have been implemented using html/template instead of text/template.

Problem Definition

The English Premier League is the top-tier league of soccer (football) teams, which consists of 20 teams. Every year, each team in the league play 38 matches (2 matches against every other team).

@tyndyll
tyndyll / README.md
Last active February 26, 2019 12:44
Introduction to Go - Hello World Server

Hello World

This gist is the code portion of a talk given at the Crystal Ball Bash.

The talk was a very high level introduction to go, and the code here is a commented example of the syntax and features that Go has to offer. It is a Hello World example, but with the twist of being a HTTP server, that uses concurrency to print out to the terminal. It looks long, but it amounts to about 50 lines of actual code once you remove the comments

Running

It is assumed that you have previously downloaded and installed Go, and configured it appropriately

Clone this gist or simply download the hello_world.go file. We are not importing any external packages so it doesn't necessarily have to exist inside the GOPATH.

#/bin/bash
#
# https://twitter.com/samykamkar/status/1011166802880020482
# Sniff network traffic from your iOS device, no jailbreak necessary! Just plug into your mac and run:
system_profiler SPUSBDataType|perl -0 -ne'/iP(?:hone|ad):.*?Serial Number: (\S+)/s?`rvictl -s $1`:0' ; sudo tcpdump -i rvi0 # standard tcpdump options/filters apply
@tyndyll
tyndyll / strip-url-trackers.py
Last active May 16, 2021 06:59
Strip UTM parameters from a URL
#!/usr/bin/env python
#
# Copyright 2018 Tyndyll
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@tyndyll
tyndyll / output.txt
Created February 21, 2018 07:53
Getting Latest Kubernetes Deployment
➜ Desktop kubectl get deployments kubia -o yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "3"
creationTimestamp: 2018-02-20T20:05:14Z
generation: 4
labels:
app: kubia-go
@tyndyll
tyndyll / Dockerfile
Last active June 28, 2017 21:11
HTTP Referer Handler for Files
FROM golang:latest
EXPOSE 8000
ENV HOST_REFERER ""
WORKDIR /go/src/app
COPY . .
RUN go-wrapper install # "go install -v ./..."
@tyndyll
tyndyll / Makefile
Created June 23, 2017 23:06 — forked from prwhite/Makefile
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@tyndyll
tyndyll / run_customer_tests.py
Created July 26, 2016 13:22 — forked from mcbhenwood/run_customer_tests.py
Run Selenium tests against the django test server, from command line with no GUI
"""
Run Selenium headless tests against Django test server
------------------------------------------------------
Creates and destroys a test environment each time.
Requires Xvfb and IceWeasel to be installed. For Debian flavours:
sudo apt-get install xvfb iceweasel