Skip to content

Instantly share code, notes, and snippets.

@Gomah
Gomah / 1. useResponsiveVariant.ts
Last active May 2, 2024 09:40
Responsive Variants with CVA, class-variance-authority
import { useMediaQuery } from 'usehooks-ts'
import { useMemo } from 'react';
import resolveConfig from 'tailwindcss/resolveConfig';
import tailwindConfig from '../../tailwind.config';
const fullConfig = resolveConfig(tailwindConfig);
const { screens } = fullConfig.theme;
type Breakpoints = keyof typeof screens;
type ResponsiveValue<T> = T extends boolean ? boolean : T extends string ? T : keyof T;
@abir-taheer
abir-taheer / instagram-follower-following.js
Last active May 2, 2024 09:36
"This is our community, this is our family, these are our friends." https://www.youtube.com/watch?v=gk7iWgCk14U&t=425s
if (window.location.origin !== "https://www.instagram.com") {
window.alert(
"Hey! You need to be on the instagram site before you run the code. I'm taking you there now but you're going to have to run the code into the console again.",
);
window.location.href = "https://www.instagram.com";
console.clear();
}
const fetchOptions = {
credentials: "include",
@mgibbs189
mgibbs189 / functions.php
Last active May 2, 2024 09:34
Flatsome - support lazy load images and quick view
<?php
add_action( 'wp_head', function() {
?>
<script>
(function($) {
$(document).on('facetwp-loaded', function() {
Flatsome.behaviors['lazy-load-images'].attach();
Flatsome.behaviors['quick-view'].attach();
});
@mandarinx
mandarinx / NormalsVisualizer.cs
Last active May 2, 2024 09:34
Visualize mesh normals in Unity3D
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MeshFilter))]
public class NormalsVisualizer : Editor {
private const string EDITOR_PREF_KEY = "_normals_length";
private Mesh mesh;
private MeshFilter mf;
private Vector3[] verts;
@pbthorste
pbthorste / Dockerfile_mssql
Last active May 2, 2024 09:32
Docker image with msssql 2022 with full text search enabled
# Docker image with msssql 2022 with full text search enabled
# based on work in: https://github.com/Microsoft/mssql-docker
# Base OS layer: Latest Ubuntu LTS
FROM --platform=linux/amd64 ubuntu:focal
# Install prerequistes since it is needed to get repo config for SQL server
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -yq curl apt-transport-https gnupg && \
@ernestkamara
ernestkamara / AdbCommands
Created June 26, 2018 08:42 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@damiencarbery
damiencarbery / flatsome-out-of-stock-to-sold.php
Last active May 2, 2024 09:30
Change Flatsome theme 'Out of Stock' label to 'Sold' - Change the 'Out of stock' banner in Flatsome theme to 'Sold'. https://www.damiencarbery.com/2020/06/change-flatsome-theme-out-of-stock-label-to-sold/
<?php
/*
Plugin Name: Change Flatsome theme 'Out of Stock' label to 'Sold'
Plugin URI: https://www.damiencarbery.com/2020/06/change-flatsome-theme-out-of-stock-label-to-sold/
Description: Change the 'Out of stock' banner in Flatsome theme to 'Sold'. Also works when [ux_products] shortcode is used.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.3
*/
@rxaviers
rxaviers / gist:7360908
Last active May 2, 2024 09:30
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@rueycheng
rueycheng / Google-Sheet-Functions.md
Last active May 2, 2024 09:28
Google Sheet functions cheatsheet

Google Sheet Functions - Cheatsheet

Based on https://support.google.com/docs/table/25273?hl=en

Array

Name Syntax Description
ARRAY_CONSTRAIN ARRAY_CONSTRAIN(input_range, num_rows, num_cols) Constrains an array result to a specified size.
BYCOL BYCOL(array_or_range, LAMBDA) Groups an array by columns by application of a LAMBDA function to each column.