Skip to content

Instantly share code, notes, and snippets.

View alexrjs's full-sized avatar

alexrjs alexrjs

View GitHub Profile
@alexrjs
alexrjs / actions.py
Last active January 13, 2024 18:25
PoC Youtube Channel Checker
"""
- Helper module for ui app actionbar
- Author: alexrjs
- License: Unlicense
"""
# imports
from flet import Container, Row, Text, UserControl
from flet import colors
[
{
"id": "6dd9c5de00783d54",
"type": "tab",
"label": "Rest API Sample",
"disabled": false,
"info": "",
"env": []
},
{
@alexrjs
alexrjs / Dockerfile
Last active May 5, 2019 06:18
Hack for json-server to allow get of count (/<name>/_count), ids (/<name>/_ids) and fields (/<name>/:field)
FROM node:current-alpine
RUN npm install -g json-server
COPY ./plural.js /usr/local/lib/node_modules/json-server/lib/server/router/plural.js
COPY ./defaults.js /usr/local/lib/node_modules/json-server/lib/server/defaults.js
HEALTHCHECK --interval=120s --timeout=15s --start-period=30s CMD wget -S --spider http://localhost:8080/
EXPOSE 80
WORKDIR /data
VOLUME /data
ENTRYPOINT ["json-server"]
CMD ["--host", "0.0.0.0", "--port", "80", "db.json"]
import sys
import random
class Rotor:
"""
Models a 'rotor' in an Enigma machine
Rotor("BCDA", 1) means that A->B, B->C, C->D, D->A and the rotor has been
rotated once from ABCD (the clear text character 'B' is facing the user)