Skip to content

Instantly share code, notes, and snippets.

@NeighborGeek
NeighborGeek / import-gvhistory.ps1
Last active April 30, 2024 11:00
Parse Google Voice data exported using Google Takeout to create useful logs of text message and phone calls
<#
.Synopsis
Parses html files produced by Google Takeout to present Google Voice call and text history in a useful way.
.DESCRIPTION
When exporting Google Voice data using the Google Takeout service, the data is delivered in the form
of many individual .html files, one for each call (placed, received, or missed), each text message
conversation, and each voicemail or recorded call. For heavy users of Google Voice, this could mean many
thousands of individual files, all located in a single directory. This script parses all of the html
files to collect details of each call or message and outputs them as an object which can then be
manipulated further within powershell or exported to a file.
@markiv
markiv / String+EmojiFlag.swift
Created April 30, 2024 10:57
Swift extension that creates a Unicode flag emoji for the given ISO region/country code.
public extension String {
fileprivate static let unicodeFlagsBase = 0x1F1E6 - UInt32("A")
/// Creates a Unicode flag emoji for the given ISO region/country code.
///
/// String(flag: "CH") // returns "🇨🇭"
/// String(flag: "in") // returns "🇮🇳"
/// String(flag: "eu") // returns "🇪🇺"
/// String(flag: "42") // returns nil
///
@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))