Skip to content

Instantly share code, notes, and snippets.

@RitRa
RitRa / exercise.md
Last active May 3, 2024 15:28 — forked from theRemix/exercise.md
MongoDB Practice

MongoDB Practice

MongoDB Exercise in mongo shell

create database

Connect to a running mongo instance, use a database named mongo_practice. use mongo_practice

Insert Documents

@aadnk
aadnk / injectApi.py
Last active May 3, 2024 15:28
Inject a REST API into Streamlit by injecting into Tornado
import logging
import threading
from typing import Any, Dict, Iterable, Optional, Union
from tornado.routing import Rule, Matcher
_global_tornado_hook = None
_global_hook_lock = threading.RLock()
class CustomRule:
def __init__(self, path_pattern: Union[str, Matcher], handler_class: Any,
@robere2
robere2 / fetchAllAuctionPages.js
Last active May 3, 2024 15:28
Fetching auction data from the Hypixel API
/**
* Robust function to fetch all auction pages from https://api.hypixel.net/v2/skyblock/auctions. If the auctions update during the time that
* this function is executing, then it will restart in order to fetch the latest data.
* @returns {Promise<Object[], Error>} Array of JSON responses from the API, with each entry being a page of auction results. The results are not necessarily in order.
* @reject {Error} Network error
* @reject {Error} If the function restarts more than five times due to updates or an API response with "success" set to false.
* @license MIT
* @author https://github.com/robere2
* @see {@link https://gist.github.com/robere2/232691590952b1f1c3de1993b291b6eb} Source
*/
@ffoodd
ffoodd / improved-sr-only.markdown
Last active May 3, 2024 15:23
Improved .sr-only

Improved .sr-only

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@fnky
fnky / ANSI.md
Last active May 3, 2024 15:23
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@bryant988
bryant988 / zillow.js
Last active May 3, 2024 15:23
Zillow Image Downloader
/**
* NOTE: this specifically works if the house is for sale since it renders differently.
* This will download the highest resolution available per image.
*/
/**
* STEP 1: Make sure to *SCROLL* through all images so they appear on DOM.
* No need to click any images.
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 3, 2024 15:25
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@paolocarrasco
paolocarrasco / README.md
Last active May 3, 2024 15:20
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@webframp
webframp / keybase.md
Created July 25, 2017 18:14
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@ardakazanci
ardakazanci / CircularMenuGroup.kt
Created April 10, 2024 07:33
Circular Menu Group with Jetpack Compose
@Composable
fun CircularMenuGroup(
icons: List<ImageVector>,
baseRadius: Float,
modifier: Modifier = Modifier,
backgroundColor: Color = Color(0xFF21FA90),
shadowElevation: Dp = 4.dp
) {
var selectedIndex by remember { mutableIntStateOf(-1) }
var sizeSliderValue by remember { mutableFloatStateOf(1f) }