Skip to content

Instantly share code, notes, and snippets.

View blockspacer's full-sized avatar
:octocat:

Devspace blockspacer

:octocat:
  • Google
  • USA
View GitHub Profile
@codebytes
codebytes / updateRepos.sh
Created March 30, 2023 17:24
a script to loop through all source repos and update the default branch from master to main
#!/bin/bash
if ! command -v gh >/dev/null 2>&1; then
echo "Install gh first"
exit 1
fi
echo "gh cli installed"
# This script
if ! gh auth status >/dev/null 2>&1; then
@blockspacer
blockspacer / 1_VcXsrv.md
Last active January 17, 2024 17:32
Install WSL2 & VcXsrv & systemd & plasma KDE & snap
Install Windows Terminal https://github.com/hubisan/emacs-wsl#use-windows-terminal

Install VcXsrv https://sourceforge.net/projects/vcxsrv/

Close everything and go to Windows Firewall with Advanced Security -> Inbound rules and delete every rule you see for Vcxsvr.exe. After that the first time you launch Vcxsvr make sure you Allow access for Private AND Public networks.

Search for VcXsrv entries (there should be two) and disable all found.

# see https://github.com/microsoft/WSL/issues/6181
@blockspacer
blockspacer / MergeSimilarFolderNamesByStringDistance.ps1
Last active June 19, 2024 07:04
Powershell `unzip.ps1` - unzip all in folder. `movebetween.ps1` - move files from folder with names matching contents of other folder. `movelonedirs.ps1` - move subdirs at upper level and remove empty subdirs
[CmdletBinding()] param () # https://stackoverflow.com/a/69203862
function Measure-StringDistance {
<#
.SYNOPSIS
Compute the distance between two strings using the Levenshtein distance formula.
.DESCRIPTION
Compute the distance between two strings using the Levenshtein distance formula.
@etd2w
etd2w / dataview_shows_db.js
Created July 31, 2022 12:50
dataview_shows_db.js
```dataviewjs
const createButton = (name) => {
const btn = dv.el('button', name)
btn.addEventListener('click', (event) => {
event.preventDefault()
removeTable()
renderTable(name)
})
btn.style.flexGrow = '1'
@Mluckydwyer
Mluckydwyer / opengl-in-wsl.md
Last active July 3, 2024 19:17
Install OpenGL on Ubuntu in WSL

How to Install OpenGL in Ubuntu in WSL2

These steps have been tested on Windows 10 with WSL2 running Ubuntu.

1. Dependencies

First install the dependencies:

apt install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev

There are more than we need, but also include GLut and Glu libraries to link aginst during compilation for application development (these can be removed if that functionality is not required).

#include <fstream>
#include <scripting/ModException.hpp>
#include <sanity.hpp>
#include "LuaSecurity.hpp"
using namespace scripting;
namespace {
void copyAll(sol::environment &env, const sol::global_table &globals,
@GuillaumeDua
GuillaumeDua / 13_valuable_things_I_learned_using_CMake.md
Last active May 25, 2024 11:14
13 valuable things I learned using CMake

13 valuable things I learned using CMake

Author : Dua Guillaume
Date : 04-26-2020

Requirement : A first experience with CMake

Intro

As a modern C++ specialist, my job is to focus on software development, from a performance and quality perspective.

@romandev
romandev / coroutine.h
Created November 14, 2019 20:14
Hacky coroutine
#ifndef COROUTINE_H_
#define COROUTINE_H_
#include <memory>
#include "base/bind.h"
using Coroutine = std::function<void(void*, void*)>;
#define co_resume_with_data(coroutine, result_ref) \
(*coroutine)(coroutine, result_ref)
@ab9rf
ab9rf / beeManager.config
Created July 19, 2019 13:44
OpenComputer lua script to automate breeding of Forestry bees. Requires Gendustry, possibly other stuff as well.
{storage={A="bottom",B="top",[1]="top",[2]="top",[3]="top",[4]="top",[5]="top",X="top"},
apiaries={
{biome="P-2H",transposer=1,side="north"},
{biome="P",transposer=1,side="south"},
{biome="P",transposer=1,side="east"},
{biome="P+2T",transposer=1,side="west"},
{biome="W",transposer=2,side="north"},
{biome="E",transposer=2,side="south"},
{biome="H",transposer=2,side="east"},
{biome="H",transposer=2,side="west"},