Skip to content

Instantly share code, notes, and snippets.

@oseiskar
oseiskar / swagger-yaml-to-html.py
Last active April 30, 2024 10:57
Converts Swagger YAML to a static HTML document (needs: pip install PyYAML)
#!/usr/bin/python
#
# Copyright 2017 Otto Seiskari
# Licensed under the Apache License, Version 2.0.
# See http://www.apache.org/licenses/LICENSE-2.0 for the full text.
#
# This file is based on
# https://github.com/swagger-api/swagger-ui/blob/4f1772f6544699bc748299bd65f7ae2112777abc/dist/index.html
# (Copyright 2017 SmartBear Software, Licensed under Apache 2.0)
#
@JBlond
JBlond / bash-colors.md
Last active April 30, 2024 10:52 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@garethredfern
garethredfern / .env.github
Last active April 30, 2024 10:52
Github workflow for Laravel CI testing using a MYSQL database.
APP_ENV=ci
APP_KEY=
SESSION_DRIVER=array
CACHE_DRIVER=array
QUEUE_DRIVER=sync
MAIL_DRIVER=log
@thimslugga
thimslugga / unifi_ubuntu_jammy.sh
Last active April 30, 2024 10:49
Install Ubiquiti UniFi Controller Software v8.x on Ubuntu 22.04 Jammy
#!/usr/bin/env bash
# Install and setup UniFi Controller Software v8.x on Ubuntu 22.04 aka Jammy
#
# * Download Ubuntu 22.04 - https://releases.ubuntu.com/jammy/
#
# * Updating and Installing Self-Hosted UniFi Network Servers (Linux) - https://help.ui.com/hc/en-us/articles/220066768
# * Self-Hosting a UniFi Network Server - https://help.ui.com/hc/en-us/articles/360012282453
# * UniFi - Repairing Database Issues on the UniFi Network Application - https://help.ui.com/hc/en-us/articles/360006634094
# * UISP Installation Guide - https://help.ui.com/hc/en-us/articles/115012196527-UNMS-Installation-Guide
@mikattack
mikattack / logger_test.go
Created August 16, 2016 19:32
Example Go unit test for logging middleware
package middleware
import (
"bufio"
"bytes"
"fmt"
"net/http"
"net/http/httptest"
"os"
"strings"
@CC1119
CC1119 / enterprise_token.rb
Last active April 30, 2024 10:44 — forked from markasoftware/enterprise_token.rb
OpenProject Enterprise mode for free
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ it doesn't show that enterprise mode is enabled in the settings, but all ################
############ enterprise mode features, such as KanBan boards, are enabled. ################
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
@Und3rf10w
Und3rf10w / Headscale setup.md
Last active April 30, 2024 10:43
How to set up headscale with SWAG in docker-compose

Overview

This document descrives the process of setting up headscale with swag, using letsencrypt certs.

This assumes you have a subdomain (e.g. wg.example.com) pointing to your SWAG instance and want to use it as a reverse proxy.

Swag .env

Add the subdomain for your desired headscale domain to your .env file.

For example: SWAG_EXTRA_DOMAINS=wg.example.com

@Chillee
Chillee / mm_weird.py
Last active April 30, 2024 10:41
Strangely, Matrix Multiplications Run Faster When Given "Predictable" Data!
import torch
torch.set_default_device('cuda')
from triton.testing import do_bench
from collections import defaultdict
from functools import partial
import random
random.seed(0)
def get_flops(A, B):
ms = do_bench(lambda: torch.mm(A, B))
@VictorTaelin
VictorTaelin / a_b_challenge.md
Last active April 30, 2024 10:41
A::B Prompting Challenge: $10k to prove me wrong!

CHALLENGE

Develop an AI prompt that solves random 12-token instances of the A::B problem (defined here), with 90%+ success rate.

RULES

1. The AI will be given a <problem/> to solve.

We'll use your prompt as the SYSTEM PROMPT, and a specific instance of problem as the PROMPT, inside XML tags. Example:

@Lekensteyn
Lekensteyn / inject-tls-secrets.py
Last active April 30, 2024 10:40
Extracts a subset of TLS secrets and injects them in an existing capture file (requires Wireshark 3.0).
#!/usr/bin/env python3
# Extracts a subset of TLS secrets and injects them in an existing capture file.
#
# Author: Peter Wu <peter@lekensteyn.nl>
import argparse
import os
import shlex
import subprocess
import sys