Skip to content

Instantly share code, notes, and snippets.

View coding-to-music's full-sized avatar
🚀

Tom Connors coding-to-music

🚀
View GitHub Profile
@sualeh
sualeh / README.md
Last active May 16, 2024 10:25
Create Nice-looking Schema Diagrams in PlantUML

Create Nice-looking Schema Diagrams in PlantUML

PlantUML is a descriptive language to generate a number of types of software diagrams, such as sequence, class, deployment and state diagrams, and many others. PlantUML does not generate very good-looking schema diagrams out of the box, but it supports themes and preprocessed macros. If you use themes and macros, you can not only use a simplified syntax, but also generate beautiful diagrams.

Here is an example of a PlantUML schema diagram, and we will build up the code to generate it.

Schema diagram

To start, describe your schemas, tables and columns using this syntax as an example.

@colinwilson
colinwilson / new_do_pricing_effective_2022.07.01.md
Last active May 17, 2022 16:19
New DigitalOcean Pricing - Prices effective starting July 1, 2022
@j-mao
j-mao / dials_algorithm_pseudocode.txt
Created January 16, 2021 07:44
Battlecode 2021 pathfinding lecture
DIAL'S ALGORITHM - PSEUDOCODE
Input:
Source = starting location
TimeToTravel[u, v] = how long to travel from u to v
C = maximum possible time a single step takes (for example, 10)
Initialize Q = list of C+1 collections of locations
If a location we want to expand has distance d, it will be stored in Q[d % (C+1)]
Initialize Expanded = an array of Booleans for the map, all false
@j-mao
j-mao / RobotPlayer.java
Created January 10, 2021 01:29
Battlecode 2021 Pathfinding lecture
/*
* Battlecode 2021
* Pathfinding Lecture - sample code
*
* Bug pathing and communication strategies. Run this on the map "Quadrants" for a sense of how
* this strategy behaves: watch the red robots in the bottom-left corner.
*
* https://www.battlecode.org/
* https://github.com/battlecode/battlecode21
*/
@alexellis
alexellis / unicorn_server.py
Created April 1, 2020 18:11
unicorn_server.py
from flask import Flask
app = Flask(__name__)
import unicornhat as UH
import time
import os
import signal
import sys
def clear_uh():
UH.clear()
@kenmoini
kenmoini / admin_sa_binding.yaml
Last active August 26, 2021 06:05
Deploy an All-in-One Kubernetes host on DigitalOcean
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
@Tynael
Tynael / README.md
Last active January 22, 2024 01:06
How to use npx to run gist based scripts
@corinneling
corinneling / web-scraper-node-js.md
Last active February 24, 2022 23:21
Node web scraper with axios and cheerio

Node JS Web Scraper

I this is part of the first node web scraper I created with axios and cheerio. I took out all of the logic, since I only wanted to showcase how a basic setup for a nodejs web scraper would look.

const cheerio = require('cheerio'),
      axios = require('axios'),
      url = `<url goes here>`;
 
@korakot
korakot / bq_easy.py
Last active March 17, 2022 10:57
Using bigquery easily in Google Colab. Focus on a single table.
import re
import pandas as pd
from google.cloud import bigquery
from google.colab import auth
PROJECT_ID = 'sql-hunt' # change to your own project
class BqTable:
def __init__(self, table, dataset='samples', active_project='bigquery-public-data', client=None):
@simonw
simonw / datasette-polar-bears.md
Last active January 17, 2022 21:16
Datasette for Polar Bears