Skip to content

Instantly share code, notes, and snippets.

View sofar's full-sized avatar
🤦‍♂️
I'm drowning in the absence of time.

sofar

🤦‍♂️
I'm drowning in the absence of time.
View GitHub Profile
diff --git a/src/client/sky.cpp b/src/client/sky.cpp
index 0ab7398f2..b19c89618 100644
--- a/src/client/sky.cpp
+++ b/src/client/sky.cpp
@@ -103,9 +103,6 @@ Sky::Sky(s32 id, RenderingEngine *rendering_engine, ITextureSource *tsrc, IShade
m_directional_colored_fog = g_settings->getBool("directional_colored_fog");
- if (g_settings->getBool("enable_dynamic_shadows"))
- m_sky_body_orbit_tilt = g_settings->getFloat("shadow_sky_body_orbit_tilt", -60.0f, 60.0f);
@sofar
sofar / configuration.yaml
Created May 24, 2019 05:46
MOFI450 Homeassistant configuration.yaml sensors
sensor:
- platform: snmp
host: 192.168.10.1
version: 2c
baseoid: .1.3.6.1.2.1.2.2.1.8.8
name: MOFI4500
accept_errors: true
- platform: snmp
host: 192.168.10.1
From a10fcdc092f1ded2099adb21800914b82798b722 Mon Sep 17 00:00:00 2001
From: Auke Kok <sofar@foo-projects.org>
Date: Mon, 11 Mar 2019 22:06:29 -0700
Subject: [PATCH] Replace .x player model with 5.0.0- compatible b3d model
This fixes the offset. It is a size-optimized version of the
Minetest Game model.
---
mods/default/models/character.b3d | Bin 0 -> 73433 bytes
mods/default/models/character.x | 7457 -----------------------------
@sofar
sofar / gist:2b0601766d9209c56aacad1e418ccdfa
Created February 21, 2018 03:32
swupd search bin/sudo
# swupd search bin/sudo
Searching for 'bin/sudo'
Bundle os-cloudguest (7 Mb)
/usr/bin/sudo
/usr/bin/sudoedit
/usr/bin/sudoreplay
Bundle os-cloudguest-aws (8 Mb)
/usr/bin/sudo
$ time ~/git/mtmapprune/mtmapprune ebl.sqlite -4890 200 7700 -15383 -100 1200
2018/02/11 12:35:53 Collecting blocks
2018/02/11 12:36:39 Deleting blocks
2018/02/11 13:49:03 Vaccuuming database. This can take a long time, please do not interrupt this process
Removed 8419241 of 9721259 blocks (limits: [-15383, -100, 1200]-[-4890, 200, 7700])
real 74m22.140s
user 5m18.357s
sys 2m19.500s
#!/bin/bash
# https://github.com/Ceryn/img
# Call with '-s' to target only a selection of the screen.
clientid='GETYOUROWNCLIENTID'
img=$(mktemp '/tmp/img-XXXXXX.png')
import $img >/dev/null 2>&1 || exit
res=$(curl -sH "Authorization: Client-ID $clientid" -F "image=@$img" "https://api.imgur.com/3/upload")
"lag": 0.024888960644602776
"lag": 0.03364704176783562
"lag": 0.049855031073093414
"lag": 0.04992730915546417
"lag": 0.05001838877797127
"lag": 0.05019672214984894
"lag": 0.05049749091267586
"lag": 0.05049918591976166
"lag": 0.05099736899137497
"lag": 0.05136791989207268
@sofar
sofar / list-modules-in-org-by-ssh-url.sh
Created June 29, 2017 17:27
lists git projects in organization by ssh url
#!/bin/bash
ORG="$1"
while true; do
((PAGE++))
URL="https://api.github.com/users/$ORG/repos?per_page=20"
if [ $PAGE -gt 1 ]; then
URL="$URL&page=$PAGE"
fi
diff --git a/src/game.cpp b/src/game.cpp
index daf2eb6b..edf80cfc 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -3999,14 +3999,10 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
*/
if (clouds) {
v3f player_position = player->getPosition();
- if (sky->getCloudsVisible()) {
- clouds->setVisible(true);
@sofar
sofar / pahole.c
Created April 21, 2017 22:26
all of mt's struct holes
struct _IO_FILE {
int _flags; /* 0 4 */
/* XXX 4 bytes hole, try to pack */
char * _IO_read_ptr; /* 8 8 */
char * _IO_read_end; /* 16 8 */
char * _IO_read_base; /* 24 8 */
char * _IO_write_base; /* 32 8 */
char * _IO_write_ptr; /* 40 8 */