Skip to content

Instantly share code, notes, and snippets.

View LensPlaysGames's full-sized avatar

Lens LensPlaysGames

View GitHub Profile
@LensPlaysGames
LensPlaysGames / CMakeLists.txt
Created January 26, 2023 20:16
GNU Fribidi CMake support automatic imported target (requires `meson`)
# NOTE: REQUIRES MESON https://mesonbuild.com
# GNU FRIBIDI (Logical to Visual reordering for bidirectional text display)
# Use the following snippet within your CMakeLists.txt, replacing your-target-here
# with the name of the CMake target you'd like to link with GNU Fribidi.
# FIXME: Untested on MacOS
include(ExternalProject)
ExternalProject_Add(ext_fribidi
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/fribidi
GIT_REPOSITORY https://github.com/fribidi/fribidi.git
CONFIGURE_COMMAND meson setup . ../ext_fribidi -Dbin=false -Ddocs=false -Dtests=false
@LensPlaysGames
LensPlaysGames / CMakeLists.txt
Created December 31, 2022 18:49
tree-sitter basic CMake project
cmake_minimum_required(VERSION 3.14)
# NOTE: Just replace all three occurences of `tree-sitter-c` to whatever language grammar you are compiling. Nothing else needs changed.
# Then just run `cmake -B bld` and `cmake --build bld` to get a shared object file that can be installed according to https://tree-sitter.github.io/tree-sitter/syntax-highlighting#paths .
project(tree-sitter-c)
add_library(
tree-sitter-c
SHARED
src/parser.c
@LensPlaysGames
LensPlaysGames / subreddits.js
Last active August 2, 2021 19:27 — forked from pixelbart/subreddits.js
Show an random image from a subreddit
// Place in your body:
// <div id="randomimg"></div>
$(function () {
GetRandRedditImage("Pics");
function GetRandRedditImage(subreddit) {
var imgcontainer = $("#randomimg");
var aRandomNum = Math.floor((Math.random() * 25) + 1);