Skip to content

Instantly share code, notes, and snippets.

@bryhal
bryhal / gist:4129042
Created November 22, 2012 02:08
MYSQL: Generate Calendar Table
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY, -- year*10000+month*100+day
db_date DATE NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
quarter INTEGER NOT NULL, -- 1 to 4
week INTEGER NOT NULL, -- 1 to 52/53
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'...
@mxalbert1996
mxalbert1996 / Scrollbar.kt
Last active March 5, 2025 00:36
Modifiers to draw scrollbars in Jetpack Compose
/*
* MIT License
*
* Copyright (c) 2022 Albert Chang
*
* 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
@Saraistupid
Saraistupid / important.md
Last active March 5, 2025 00:35
"ATTENTION TO ALL WINDOWS USERS" by Mental Outlaw

This is a public service announcement to anyone who is foolish enough to still be using Windows 10, Windows 8, Windows 7, Vista, and also Windows XP.

Your operating system is now fully compromised. and no, this isn't the same as Indian scammers trying to hold your data hostage for Google play cards or pictures of bobs and vagens or the CIA backdooring your operating system so they can spy on you, it is far worse than that.

The international hacker known as 4Chan has successfully reverse-engineered your operating system, THEY KNOW THE SOURCE CODE, they observed all of Windows XP vulnerabilities which means they know the vulnerabilities of all Windows operating systems that have come after it, because, let's face it, ever since Windows XP all Microsoft has really done is create some new themes for your desktop and add more spyware to Windows and also push out updates. and things are about to get EVEN WORSE, you thought viruses like WannaCry cause a lot of damage? that's child's play, the viruses of old were c

@BigNerd
BigNerd / k9s.txt
Last active March 5, 2025 00:24
K9s column descriptions
View: Pods(<namespace>)[number of pods listed]
NAME pod name
READY number of pods in ready state / number of pods to be in ready state
RESTARTS number of times the pod has been restarted so far
STATUS state of the pod life cycle, such as Running | ... | Completed
CPU current CPU usage, unit is milli-vCPU
MEM current main memory usage, unit is MiB
%CPU/R current CPU usage as a percentage of what has been requested by the pod
%MEM/R current main memory usage as a percentage of what has been requested by the pod
@bradhowes
bradhowes / code_coverage.md
Created December 21, 2021 18:00
Github Action for Swift Code Coverage
  1. Create a Github action for your SwiftPM project.
  2. Add a step to build: swift build
  3. Add a step to run tests: swift test --enable-code-coverage
  4. Fetch coverage value (see below)
  5. Write coverage value to gist and generate badge from it

For step #4, we need to do some sleuthing and digging around into artifacts created by the Swift toolchain. First, we need to find the location of the XCTest bundle that step #3 generated and save it in an environment variable:

@coltenkrauter
coltenkrauter / detailed-home-assistant-os-installation-in-vm-on-truenas-scale.md
Last active March 5, 2025 00:23
Comprehensive instructions for installing Home Assistant OS in a VM on TrueNAS SCALE.

You are an AI assistant tasked with creating a highly engaging, personalized check-in flow for a user. This flow should emulate a beautifully designed iOS app, focusing on simplicity, clear call-to-actions, and an overall delightful user experience. Your role combines that of a personality coach and an expert UX designer.

Here's the theme for today's check-in: {{THEME}}

And here's the context we have about the user: <user_context> {{USER_CONTEXT}}

@Alabate
Alabate / usb-android-emulator-ubuntu.md
Last active March 5, 2025 00:21
Use custom USB device with Android emulator by using custom built kernel on Ubuntu 18.04

Use custom USB device with Android emulator by using custom built kernel on Ubuntu 18.04

The android emulator doesn't support all usb devices because they are disabled in the kernel. So we need to build it with another configuration. My goal was to build the same version as it was before, but with just configuration modifications.

Find current android version

Start the emulator without modifications, go into

Configuration > System > About emulated device > Android version

@kshaanu
kshaanu / dotnet_iis_demo.yml
Created February 13, 2020 16:11
Demo playbook to install IIS, .NET Core dependencies, create a sample web app, and finally host that app via IIS
---
##
# Demo playbook to install IIS, .NET Core dependencies, create a sample web app, and finally host that app via IIS
#
- name: Full Ansible demo for Rev
hosts: windows
gather_facts: no
vars:
temp_dir: C:\Users\Administrator\Downloads
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active March 5, 2025 00:18
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized