Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@marina-mosti
marina-mosti / useEmptySlotCheck.js
Last active April 23, 2024 09:40
Vue 3 check for slot with no content
import { ref, computed, onBeforeUpdate, Comment, Fragment, Text, useSlots } from 'vue'
// Adapted from https://github.com/vuejs/vue-next/blob/ca17162e377e0a0bf3fae9d92d0fdcb32084a9fe/packages/runtime-core/src/helpers/renderSlot.ts#L77
// Demo: https://play.vuejs.org/#eNqVVm1P3EYQ/iuDU+UOdNiEa0NBHE2gRE1bJVWg/RJH1Z49PhvstbW7PkDX+++d2bV9vmCIggTa3Xl7ZuaZMSvvbVX5yxq9E+9URyqrDGg0dXUWyqyoSmXgoiwqSFRZwMgP+MLqo068AoXJBEp5jkmp8O8qFgYnUGu8ykujYd3YOqNQRqXUBgq9gBlbjke/ZTuj3Y3ElItFbm1JYbwLszMKEUpgE38p8hrpfXP+BWSd53AC1k8o16E8DVwilAJdDBZVTpDoBnDK+O0JYLWyKNZk4R46VXghRYFnaXYabFvb9K1busxrY0oJb6I8i25nobcBHnpnF/wIBZ4GTo2Mes68iWc0pZtkC/9Gl5KKv2KfoRdRgCxH9bEyGZUj9E7ASlgm8ry8+92+GVXjpH2PUoxuB95v9D2/hd5fCjWqJYZeJzNCLZCAsvjy6gPe07kTFmVc56T9jPAT6jKvGaNTO69lTLB7ehbte8uRTC6u9eW9QanbpBgoa66tfugRO7i2T6W+gTv1p9aOOk1VbOnI7N1ulWYCcRu5M6jJFoKehM9b3aXrMP2/j9+N0RX7uCwq88BKF9ygboQGZL3BYHSaGN76H9NoOMkKCK0z0hOIMckkxi2G2VDIsXVmZ2sb/riZK64HOy9z9PNyMXbl3oRxM7YdzL2xJjle0283btSPARBEcOrO88WkNhYozQTeKbFwp2ti3aPdEeztUeA9+BUNqoIgabhL0aSoQNjKQaYdfCD38A/th+k
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 23, 2024 09:38
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

@lohanidamodar
lohanidamodar / firestore_service.dart
Created February 19, 2020 02:30
Flutter firestore generic helper class
import 'package:cloud_firestore/cloud_firestore.dart';
class DatabaseService<T> {
final String collection;
final Firestore _db = Firestore.instance;
final T Function(String, Map<String,dynamic>) fromDS;
final Map<String,dynamic> Function(T) toMap;
DatabaseService(this.collection, {this.fromDS,this.toMap});
Future<T> getSingle(String id) async {
var snap = await _db.collection(collection).document(id).get();
if(!snap.exists) return null;
@integeruser
integeruser / extract-symbol-info-in-macho.py
Last active April 23, 2024 09:36
Extract symbols information (e.g. addresses) from Mach-O files
#!/usr/bin/env python3
import ctypes
LC_SYMTAB = 0x2
class mach_header_64(ctypes.Structure):
_fields_ = (
("magic", ctypes.c_uint32),
("cputype", ctypes.c_uint32),
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 23, 2024 09:35
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@lavantien
lavantien / modern-software-engineering-resources.md
Last active April 23, 2024 09:33
Modern Software Engineering Resources

Modern Software Engineering

Knowledge and Education should be open and free. Hierarchy and Exploitation must be abolished.

  • Z. (down) Notes below. Avoid funnel sales, if you spent money, there's something wrong. Also don't forget good OpSec, self defense gears, and physical/mental strength.
  • A. (go) Development Environment.
  • B. (go) Complementary Subjects (Linguistics, English, Security, OpSec, Psychology, Anthropology, History, Philosophy, Economics, Business, Defense, Cooking, Xenology, Self Defense).
  • C. (go) Fundamentals of Science and Technology (Logic, Physics (Classical/Quantum Mechanics, Thermodynamics, Electricity, Relativity, Electronics, Electromagnetism, Optoelectronic, Semiconductor, Fusion), Mathematics (Calculus, Linear Algebra, Statistics, Applied Math), Game Theory, Biology, Medical, and Their Applications).
  • D. ([go](#d-computer-science-and-competitiv
@msmuenchen
msmuenchen / README.md
Last active April 23, 2024 09:30
Flying a drone in Germany

This article intends to provide a quick refresher and reference guide for aspiring drone pilots in German territory, particularly those from outside the EU.

Disclaimer: The author is not a law professional and assumes no liability, but strives to keep this guide up-to-date and factually correct. Please check the laws yourself before conducting a flight. No commission, referrals or similar awards have been provided to the author. The guide only applies to actual EU member states and Germany specifically, unless noted otherwise. The author has no knowledge about the edge cases Switzerland, Norway, Iceland, Liechtenstein and the UK - they may or may not have adopted the EU regulations. Please file a comment if you have corrections, questions, new edge cases or links to state-specific information.

Basic EU-wide rules

German drone law follows the basic EU harmonized rules:

Drone classes

  • Drones are classified by weight and capabilities by the manufacturer:
  • C0 drones weigh below 250g (e.g. the DJ
@BCasal
BCasal / Colaborar Proyecto GitHub.markdown
Last active April 23, 2024 09:29
Pasos a seguir para colaborar en un proyecto de GitHub

Cómo colaborar en un proyecto en GitHub

  • Fork del repositorio
  • Clonar el repositorio
  • Actualizar la rama master
  • Crear una rama
  • Hacer los cambios
  • Hacer un Pull Request

Fork del repositorio

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@fabiomontefuscolo
fabiomontefuscolo / wp-migration.markdown
Last active April 23, 2024 09:28
BedRock WordPress + Nginx w Cache + php-fpm

Instalação dos pacotes do Ubuntu

apt-get install pv nginx-extras                                   \
    php-fpm php-gd php-mbstring php-cli php-mysql php-zip php-xml \
    mariadb-server mariadb-client

Instalação do WP-CLI