Skip to content

Instantly share code, notes, and snippets.

View blockspacer's full-sized avatar
:octocat:

Devspace blockspacer

:octocat:
  • Google
  • USA
View GitHub Profile
@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"},
@blockspacer
blockspacer / enum_bitmask.hpp
Created April 18, 2019 15:53 — forked from StrikerX3/enum_bitmask.hpp
Type-safe enum bitmasks
/*
Type-safe enum class bitmasks.
Based on work by Andre Haupt from his blog at
http://blog.bitwigglers.org/using-enum-classes-as-type-safe-bitmasks/
To enable enum classes to be used as bitmasks, use the ENABLE_BITMASK_OPERATORS
macro:
enum class MyBitmask {
None = 0b0000,
One = 0b0001,
Two = 0b0010,
@kassane
kassane / Event_Loop.md
Created April 6, 2019 14:26
Explain Event Loop

Event Loop

In computer science, the event loop, message dispatcher, message loop, message pump, or run loop is a programming construct that waits for and dispatches events or messages in a program.

It works by making a request to some internal or external "event provider" (that generally blocks the request until an event has arrived), and then it calls the relevant event handler ("dispatches the event").

The event-loop may be used in conjunction with a reactor, if the event provider follows the file interface, which can be selected or 'polled' (the Unix system call, not actual polling).

The event loop almost always operates asynchronously with the message originator.

@blockspacer
blockspacer / new_ubuntu.md
Last active September 10, 2023 17:00
fresh ubuntu

Fresh ubuntu? Try this!

TODO: to script with select screen. Extend functionality of https://github.com/cesar-rgon/desktop-app-installer

Keyboard layout switch hotkeys

sudo apt install gnome-tweaks -y
gsettings set org.gnome.desktop.input-sources xkb-options "['grp:ctrl_shift_toggle']"
gsettings set org.gnome.desktop.input-sources xkb-options "['grp:alt_shift_toggle']"
@StrikerX3
StrikerX3 / enum_bitmask.hpp
Last active March 10, 2023 13:40
Type-safe enum bitmasks
/*
Type-safe enum class bitmasks.
Based on work by Andre Haupt from his blog at
http://blog.bitwigglers.org/using-enum-classes-as-type-safe-bitmasks/
To enable enum classes to be used as bitmasks, use the ENABLE_BITMASK_OPERATORS
macro:
enum class MyBitmask {
None = 0b0000,
One = 0b0001,
Two = 0b0010,
@niklas-ourmachinery
niklas-ourmachinery / reducing-build-times.md
Created January 24, 2019 16:30
Reducing build times by 20 % with a one line change

Reducing build times by 20 % with a one line change

Experimenting a bit with the /d2cgsummary and /d1reportTime flags described by Aras here and here I noticed that one of our functions was consistently showing up in the Anomalistic Compile Times section:

1>	Anomalistic Compile Times: 2
1>		create_truth_types: 0.643 sec, 2565 instrs
1>		draw_nodes: 0.180 sec, 5348 instrs
@PatWie
PatWie / glfw_ship.cpp
Created December 5, 2018 03:53 — forked from ad8e/glfw_ship.cpp
instructions to use skia and glfw together. (download, installation, first program). works on Linux and Windows.
/* Note: this Google copyright notice only applies to the original file, which has large sections copy-pasted here. my changes are under CC0 (public domain).
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
this is intended as a second-resort, after trying to build using the official instructions inevitably fails because of poor documentation and strange build systems.
@tonistiigi
tonistiigi / Dockerfile
Last active September 10, 2020 04:37 — forked from brad-jones/Dockerfile
buildkit cache reproducer - see: https://github.com/moby/buildkit/issues/723
FROM alpine:latest AS devel
RUN apk --no-cache add git
RUN mkdir /app
RUN touch /app/foo
FROM scratch AS runtime
COPY --from=devel /app/. /app
@EIREXE
EIREXE / Godot Minimap.md
Last active April 17, 2025 11:48
Automatic minimap generation in godot

Building an automated map/minimap system in Godot

Why?

Our game, ERO-ONE needed a minimap system, it being an open world game made this a necessity, otherwise the player wouldn't really know where he's going.

Of course making a proper minimap is hard, we told ourselves that our game didn't really need it because it's not as big as the open world powerhouse that is Grand Theft Auto, but the real reasons are...

shader_type spatial;
render_mode shadows_disabled;
uniform float rim = 0.25;
uniform float rim_tint = 0.5;
uniform sampler2D albedo : hint_albedo;
uniform float specular;
uniform float roughness = 1.0;
uniform bool disable_lighting = false;
uniform vec4 shadow_color : hint_color;