Skip to content

Instantly share code, notes, and snippets.

@logseq-cldwalker
logseq-cldwalker / query-dsl-example-rules.txt
Last active May 15, 2024 17:23
Examples of rules that can be used from advanced query
$ node static/tests.js -r dsl |grep EXAMPLE: | grep -v -E 'and|or|not' | uniq
EXAMPLE: (property ?b :prop-a "val-a")
EXAMPLE: (property ?b :prop-b "val-b")
EXAMPLE: (property ?b :prop-c "page c")
EXAMPLE: (property ?b :prop-c "page b")
EXAMPLE: (property ?b :prop-c "page c")
EXAMPLE: (property ?b :prop-b "val-b")
EXAMPLE: (property ?b :prop-num 2000)
EXAMPLE: (property ?b :prop-linked-num 3000)
@UbuntuEvangelist
UbuntuEvangelist / How To Install PHP (8.2, 8.1, 7.4) on Ubuntu 22.04
Last active May 15, 2024 17:23
Install PHP (8.2, 8.1, 7.4) on Ubuntu 22.04
sudo apt update && sudo apt upgrade
sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https
LC_ALL=C.UTF-8 sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.1
# Check active php version php -v
php -v
# Check system php version
php --version
# To install another php version same machine
@psiborg
psiborg / readme.md
Last active May 15, 2024 17:23
Apple Magic Mouse and Windows 10 #windows
  1. Download the latest version of the "Boot Camp Support Software" (e.g., 5.1.5722) from https://support.apple.com/downloads/bootcamp
  2. Unzip the file (e.g., bootcamp5.1.5722.zip) to a new directory
  3. Run BootCamp\Drivers\Apple\AppleWirelessMouse64.exe
  4. Turn on Bluetooth and pair your Magic Mouse

Note: Apple wireless mouse devices have a built-in passcode of "0000" (four zeros).

@cpq
cpq / embed.c
Last active May 15, 2024 17:20
How to embed data files into C/C++ executable
// Copyright (c) Sergey Lyubka, 2013.
// All rights reserved.
// Released under the MIT license.
// This program is used to embed arbitrary data into a C binary. It takes
// a list of files as an input, and produces a .c data file that contains
// contents of all these files as collection of char arrays.
// Usage:
// 1. Compile this file:
// cc -o embed embed.c
@thdaraujo
thdaraujo / deprecator_mixin.rb
Created February 22, 2024 03:18
An example of how to deprecate constants in Ruby.
# based on ActiveSupport
# https://github.com/rails/rails/blob/6f0d1ad14b92b9f5906e44740fce8b4f1c7075dc/activesupport/lib/active_support/deprecation/constant_accessor.rb#L32
module MyLib
module Deprecator
def self.included(base)
extension = Module.new do
def const_missing(missing_const_name)
puts "deprecator - const missing #{missing_const_name}"
if class_variable_defined?(:@@_deprecated_constants)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<title>Dates</title>
<style>
@arturo182
arturo182 / bom2grouped_csv_jlcpcb.xsl
Last active May 15, 2024 17:16
A KiCad BOM script for generating JLCPCB PCBA-compatible files!
<!--XSL style sheet to convert EESCHEMA XML Partlist Format to grouped CSV BOM Format
Copyright (C) 2014, Wolf Walter.
Copyright (C) 2013, Stefan Helmert.
Copyright (C) 2018, Kicad developers.
Copyright (C) 2019, arturo182.
GPL v2.
Functionality:
Generation of JLCPCB PCBA compatible BOM
@Ta180m
Ta180m / WSL 2 GNOME Desktop.md
Last active May 15, 2024 17:14
Set up a GNOME desktop environment on WSL 2

WSL 2 GNOME Desktop

NOTE: If you want the ultimate Linux desktop experience, I highly recommend installing Linux as your main OS. I no longer use Windows (except in a VM) so I will not be maintaining this guide anymore.

Think Xfce looks dated? Want a conventional Ubuntu experience? This tutorial will guide you through installing Ubuntu's default desktop environment, GNOME.

GNOME is one of the more complex — and that means more difficult to run — desktop environments, so for years people couldn't figure [o

@bakavets
bakavets / kubernetes-certifications.md
Last active May 15, 2024 17:13
How I passed Kubernetes KCNA, CKAD, CKA, and CKS exams. My experience. Exam tips and tricks.

Logseq Plugin Setup Guide

[WIP] Logseq Plugin System is currently under Alpha Testing phase.

For Developers

In this short guide, it will walk you through the steps needed to set up your development environment for writing and running a hello world simple inside of Logseq Desktop Client. You know Logseq Plugin based on Web Technologies composed of JS & HTML & CSS, but neither are mandatory, you can develop plugins use any language which can be translated to javascript (Logseq made by Clojurescript!). We will use Typescript to demonstrate this sample. Because there is a type definition file to make development experience even better.

Install Node.js and NPM