Skip to content

Instantly share code, notes, and snippets.

@ride90
ride90 / mongo_cascade_delete.js
Last active April 23, 2024 17:40
How to implement a cascade delete in MongoDB
// equivalent of cascade delete in MongoDB
/**
* Let's assume you have 2 related collections with next data structure.
*
* - `archive`
* {
* "_id" : ObjectId("5ce5138efe985e8424a79304"),
* "type" : "text",
* "headline" : "Curabitur non nulla sit amet nisl tempus convallis quis ac lectus."
@lwsrbrts
lwsrbrts / smart_home_panel.yaml
Created March 26, 2023 12:25
Ecoflow Smart Home Panel YAML configuration for Home Assistant
sensor:
# These should be used in the energy dashboard.
- platform: integration
source: sensor.shp_circuit_1_power
name: SHP Circuit 1 Consumed Energy
unit_prefix: k
round: 3
- platform: integration
source: sensor.shp_circuit_2_power
name: SHP Circuit 2 Consumed Energy
@TheColdPrince
TheColdPrince / WikiFeed - Wikipedia Blogger Template
Last active April 23, 2024 17:39
Wikipedia Blogger Template - Blogger theme with a strong Wiki-style. WikiFeed is suitable for encyclopedic websites. The theme helps you to create an encyclopedia out of your blog! With the help of Blogger, we can now create our own Wikipedia. Code that is easy to use and alter, as well as clean and understandable. WikiFeed is a content-focused …
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html b:responsive='true' b:version='2' class='v2' expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<meta content='width=device-width, initial-scale=1.0' name='viewport'/>
<!-- Meta Title -->
<meta content='WikiFeed-Blogger' property='og:title'/>
<meta content='WikiFeed-Blogger' property='og:image:alt'/>
<meta content='WikiFeed-Blogger' name='twitter:title'/>
<meta content='WikiFeed-Blogger' name='twitter:image:alt'/>
@cecepm
cecepm / install-meslo-fonts.sh
Created April 12, 2021 01:30
Install Meslo Nerd Font patched for Powerlevel10k
mkdir -p ~/.fonts
curl -L https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf --output ~/.fonts/'MesloLGS NF Regular.ttf'
curl -L https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf --output ~/.fonts/'MesloLGS NF Bold.ttf'
curl -L https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf --output ~/.fonts/'MesloLGS NF Italic.ttf'
curl -L https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf --output ~/.fonts/'MesloLGS NF Bold Italic.ttf'
@JohannesMP
JohannesMP / EnableDiscordDevExperiments.md
Last active April 23, 2024 17:37 — forked from ExordiumX/betaenabler.js
Enabling Discord Dev Experiments on Discord for Windows (2022-02)

Enable Dev Experiments in Discord for Windows

image

This guide shows how to enable dev mode for the Discord desktop application running on Windows (as of February 2022).

This can be used to view beta experiments to try features currently in development that are included but hidden by default in Discord release builds.


@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 23, 2024 17:36
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@SwampDragons
SwampDragons / README.md
Created June 7, 2022 16:49
Using a Nook Simple Touch in 2022

Using an old Barnes and Noble Nook Device

I got an ancient nook "simple touch" for free on a neighborhood Facebook group yesterday. Figured I could see if I at least like the form factor before getting myself a newer one.

Step 1: Charge it

When I got it, the battery was completely dead. I plugged it in to charge (thankfully a micro-USB charger). After about 20 minutes, it was ready to work on.

Step 2: Hardware Reset

@jboner
jboner / latency.txt
Last active April 23, 2024 17:34
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@catalinmiron
catalinmiron / README.md
Created April 16, 2024 20:36
Expo app.json Apple Privacy Manifest

About

The privacy details that you may need to add for Apple Privacy Manifest.

This config plugin it's already available from expo >=50.0.17 (Part of this PR by aleqsio)

Tip

Read more about Privacy Manifest File from Apple docs

@paulmillr
paulmillr / active.md
Last active April 23, 2024 17:32
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)