Skip to content

Instantly share code, notes, and snippets.

@eYinka
eYinka / tailwind-radial-progress-bar.txt
Last active May 2, 2024 17:20
Tailwind CSS Radial Progress Bar
// Inspired by Tailwind Daisy UI progress bar: https://daisyui.com/components/radial-progress/
// This is a custom-made progress circular/radial progress bar with centered percentage text.
// Tested with Tailwind 3.x. Should work with lower versions of Tailwind CSS as well.
STEP 1: Add the following custom CSS:
.progress-ring__circle {
transition: stroke-dashoffset 0.35s;
transform: rotate(-90deg);
transform-origin: 50% 50%;
@Voloshin-Sergei
Voloshin-Sergei / commit.md
Created November 3, 2020 13:10
Шпаргалка по оформлению коммитов

Требования к именам коммитов

  • Названия коммитов должны быть согласно гайдлайну
  • Должен использоваться present tense ("add feature" not "added feature")
  • Должен использоваться imperative mood ("move cursor to..." not "moves cursor to...")

Примеры имен коммитов

init: - используется для начала проекта/таска. Примеры:
  • init: start youtube-task
  • init: start mentor-dashboard task
@JamesDunne
JamesDunne / i2c.c
Last active May 2, 2024 17:20
C library for reading/writing I2C slave device registers from Raspberry Pi 1 Model B
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <linux/i2c-dev.h>
// Terrible portability hack between arm-linux-gnueabihf-gcc on Mac OS X and native gcc on raspbian.
#ifndef I2C_M_RD
#include <linux/i2c.h>
#endif
@ThakurSarveshGit
ThakurSarveshGit / BoilerplateMultiThreading.cpp
Last active May 2, 2024 17:19
Boiler plate code for Multithreading camera(s) for faster FPS. Check writeup here:
/*
* Boilerplate code for handling cameras for computer vision tasks.
* Date Created: 2/4/2020
* Author: Sarvesh Thakur
*/
#include "Interaction.h"
@ramonfincken
ramonfincken / WooCommerce_search_order_ip.php
Last active May 2, 2024 17:18
Add search by customer IP address to Woocommerce order search
<?php
// NOTE, see updates function managedwphosting_woocommerce_order_query_args
/**
* Inspired by https://stackoverflow.com/questions/53140009/add-search-by-customer-ip-address-to-woocommerce-order-search
* Code idea borrowed from https://www.skyverge.com/blog/filtering-woocommerce-orders/ && https://gist.github.com/bekarice/41bce677437cb8f312ed77e9f226a812
*/
add_filter( 'request', 'filter_orders_by_payment_method_query' );
function filter_orders_by_payment_method_query( $vars ) {
@nickytonline
nickytonline / async-awaitable-dom-event-handler.js
Last active May 2, 2024 17:18
async/await"able DOM event handlers
// async/await"able" DOM event handlers
async function getMeSomeData() {
// ...
return data
}
document.addEventListener('DOMContentLoaded', async () => {
const someContainer = document.getElementById('someContainer');
@metatablecat
metatablecat / b64.lua
Last active May 2, 2024 17:17
The fastest luau base64 library in the west. This has been benchmarked within Roblox Luau, results may vary
local SEQ = {
[0] = "A", "B", "C", "D", "E", "F", "G", "H",
"I", "J", "K", "L", "M", "N", "O", "P",
"Q", "R", "S", "T", "U", "V", "W", "X",
"Y", "Z", "a", "b", "c", "d", "e", "f",
"g", "h", "i", "j", "k", "l", "m", "n",
"o", "p", "q", "r", "s", "t", "u", "v",
"w", "x", "y", "z", "0", "1", "2", "3",
"4", "5", "6", "7", "8", "9", "+", "/",
}
@algal
algal / loadPoints.swift
Created December 28, 2018 19:41
Read vertex positions with Model I/O
// known-good: Swift 4.2, macOS
import Foundation
import ModelIO
private func LogDebug(_ s:Any) -> Void { print(s) }
private func LogInfo(_ s:Any) -> Void { print(s) }
private func LogError(_ s:Any) -> Void { print(s) }
struct POINT3D {
var x:Float
@manuelvicnt
manuelvicnt / ProvideViewModels.kt
Last active May 2, 2024 17:16
Scope ViewModels to Composables
// PLEASE, READ
//
// This is a way to scope ViewModels to the Composition.
// However, this doesn't survive configuration changes or procress death on its own.
// You can handle all config changes in compose by making the activity handle those in the Manifest file
// e.g. android:configChanges="colorMode|density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode">
//
// This is just an exploration to see what's possible in Compose. We don't encourage developers to copy-paste
// this code if they don't fully understand the implications of it and if this actually solves the use case to solve.
@bennadel
bennadel / app.component.ts
Created May 1, 2018 12:42
Creating A Medium-Inspired Text Selection Directive In Angular 5.2.10
// Import the core angular services.
import { Component } from "@angular/core";
// Import the application components and services.
import { TextSelectEvent } from "./text-select.directive";
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
interface SelectionRectangle {