Skip to content

Instantly share code, notes, and snippets.

View nmanumr's full-sized avatar

Nauman Umer nmanumr

View GitHub Profile
@moskrc
moskrc / next_previous.py
Created June 26, 2012 10:50 — forked from dokterbob/next_previous.py
Django template tag to efficiently get the next or previous object in the Django queryset, with regards to the item specified.
from django import template
register = template.Library()
from templatetag_sugar.register import tag
from templatetag_sugar.parser import Constant, Variable, Name
from .utils import get_next_or_previous
"""
Efficient and generic get next/previous tags for the Django template language,
@codediodeio
codediodeio / config.js
Last active July 23, 2024 02:55
Snippets from the Firestore Data Modeling Course
import * as firebase from 'firebase/app';
import 'firebase/firestore';
var firebaseConfig = {
// your firebase credentials
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
@dillonchanis
dillonchanis / example.css
Created September 20, 2020 14:44
Tailwind Utility for using gradients with text
@layer utilities {
.text-gradient {
background-clip: text;
-webkit-text-fill-color: transparent;
}
}
@fabiospampinato
fabiospampinato / lag_bar.tsx
Created April 23, 2023 19:56
My lag bar implementation for Voby
/* IMPORT */
import {$, $$, useEffect, useInterval} from 'voby';
/* STYLE */
css`
:root {
--lag-bar-color-bg: var(--color-black-bg);
import * as React from 'react';
const useIsFirstRender = (): boolean => {
const isFirst = React.useRef(true);
if (isFirst.current) {
isFirst.current = false;
return true;
} else {
import {
ElementRef,
ForwardRefExoticComponent,
createElement,
forwardRef,
} from "react";
import { cn } from "./utils";
export function extend<T extends { className?: string }>(
Component: ForwardRefExoticComponent<T>,