Skip to content

Instantly share code, notes, and snippets.

@darrenwiens
darrenwiens / index.html
Created April 29, 2024 23:55
High Res Canopy Height COG viewer
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>High Resolution Canopy Height</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<link href="https://api.mapbox.com/mapbox-gl-js/v3.2.0/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v3.2.0/mapbox-gl.js"></script>
<style>
@Strus
Strus / clangd.md
Last active April 30, 2024 11:11
How to use clangd C/C++ LSP in any project

How to use clangd C/C++ LSP in any project

tl;dr: If you want to just know the method, skip to How to section

Clangd is a state-of-the-art C/C++ LSP that can be used in every popular text editors like Neovim, Emacs or VS Code. Even CLion uses clangd under the hood. Unfortunately, clangd requires compile_commands.json to work, and the only way to painlessly generate it is to use CMake.

But what if I tell you you can quickly hack your way around that, and generate compile_commands.json for any project, no matter how compilcated? I have used that way at work for years, originaly because I used CLion which supported only CMake projects - but now I use that method succesfully with clangd and Neovim.

Method summary

Basically what we need to achieve is to create a CMake file that will generate a compile_commands.json file with information about:

#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@rutcreate
rutcreate / README.md
Last active April 30, 2024 11:10
Install Python 3.10.x on Ubuntu 20.04

Prerequisite

sudo apt update
sudo apt install software-properties-common -y

Add custom APT repository

@Igloczek
Igloczek / verify-email.js
Last active April 30, 2024 11:08
Simple way to filter out most of the disposable / temporary emails
import TTLCache from "@isaacs/ttlcache"
import axios from "axios"
const domainsCache = new TTLCache({
ttl: 1000 * 60 * 60 * 24, // cache for 24h
})
const lists = [
"https://raw.githubusercontent.com/wesbos/burner-email-providers/master/emails.txt", // submiting my findings here
"https://raw.githubusercontent.com/Igloczek/burner-email-providers/master/emails.txt", // adding my fork, as sometime PRs are stuck unmerged
@vikaskore
vikaskore / RecordAudioViewController.swift
Last active April 30, 2024 11:05
Record and Play audio in iOS Swift
//
// RecordAudioViewController.swift
// Samples
//
// Created by VikasK on 11/02/19.
// Copyright © 2019 Vikaskore Software. All rights reserved.
//
import UIKit
import AVFoundation
@edokeh
edokeh / index.js
Last active April 30, 2024 11:03
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@kskmori
kskmori / trac2md.py
Last active April 30, 2024 11:01
Trac Wiki to Markdown converter
#!/usr/bin/env python
#
# Trac Wiki to Markdown converter
#
# Copyright(c) 2019 Keisuke MORI (keisuike.mori+ha@gmail.com)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
@NeighborGeek
NeighborGeek / import-gvhistory.ps1
Last active April 30, 2024 11:00
Parse Google Voice data exported using Google Takeout to create useful logs of text message and phone calls
<#
.Synopsis
Parses html files produced by Google Takeout to present Google Voice call and text history in a useful way.
.DESCRIPTION
When exporting Google Voice data using the Google Takeout service, the data is delivered in the form
of many individual .html files, one for each call (placed, received, or missed), each text message
conversation, and each voicemail or recorded call. For heavy users of Google Voice, this could mean many
thousands of individual files, all located in a single directory. This script parses all of the html
files to collect details of each call or message and outputs them as an object which can then be
manipulated further within powershell or exported to a file.
@markiv
markiv / String+EmojiFlag.swift
Created April 30, 2024 10:57
Swift extension that creates a Unicode flag emoji for the given ISO region/country code.
public extension String {
fileprivate static let unicodeFlagsBase = 0x1F1E6 - UInt32("A")
/// Creates a Unicode flag emoji for the given ISO region/country code.
///
/// String(flag: "CH") // returns "🇨🇭"
/// String(flag: "in") // returns "🇮🇳"
/// String(flag: "eu") // returns "🇪🇺"
/// String(flag: "42") // returns nil
///