Skip to content

Instantly share code, notes, and snippets.

View icek's full-sized avatar

Grzegorz Michlicki icek

View GitHub Profile
@beledouxdenis
beledouxdenis / dell-vostro-5481-noisy-fan.md
Last active February 25, 2020 10:16
Dell Vostro 5481 Ubuntu Noisy fans solution

Make sure to disable secure boot in bios, otherwise /usr/local/bin/dell-bios-fan-control 0 will return a segfault.

cd /tmp
git clone https://github.com/TomFreudenberg/dell-bios-fan-control
cd dell-bios-fan-control
make
sudo cp dell-bios-fan-control /usr/local/bin/
sudo apt install i8kutils
sudo mkdir /etc/systemd/system/i8kmon.service.d
echo "[Service]
@oren-l
oren-l / ubuntu-suspend-fix.txt
Last active August 26, 2019 18:29
Solution for Ubuntu suspend not resuming previous state
Issue: After waking up from suspend, the system does not resume the previous state.
Hardware: Dell Vostro 5481 i5 8265U
OS: Ubuntu 18.04.1
Solution:
from https://ubuntuforums.org/showthread.php?t=1556934
1. create folder '/etc/grub' -- `sudo mkdir /etc/grub`
@nadako
nadako / Main.hx
Created June 24, 2015 19:36
Haxe + SDL = native love \o/
class Main {
static function main() {
Sdl.init(Sdl.INIT_EVERYTHING);
var win = Sdl.createWindow("Hello", 100, 100, 800, 600, Sdl.WINDOW_OPENGL);
var ren = Sdl.createRenderer(win, -1, Sdl.RENDERER_ACCELERATED);
var bmp = Sdl.loadBMP("test.bmp");
var tex = Sdl.createTextureFromSurface(ren, bmp);
Sdl.freeSurface(bmp);
for (i in 0...3) {
@nadako
nadako / Main.hx
Last active November 27, 2020 16:08
Signal builder using new Rest type parameter in Haxe
class Main {
static function main() {
var signal = new Signal<Int,String>();
var conn = signal.connect(function(a, b) {
trace('Well done $a $b');
});
signal.dispatch(10, "lol");
}
}
@puffnfresh
puffnfresh / Example.hx
Last active March 6, 2020 01:09
Macro to generate "value classes" in Haxe
import precog.macro.ValueClass;
class ABC implements ValueClass {
var a: Int;
var b: Bool;
var c: String;
}
/*
class ABC extends ValueClass {
@andyli
andyli / AbstractClass.hx
Last active June 24, 2021 13:40
Java abstract class implemented in Haxe macros. Related: https://groups.google.com/forum/?fromgroups=#!topic/haxelang/WzeI-N1XbIg
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.Type;
using Lambda;
/**
Old school abstract class.
Classes that implements it, and their sub-classes, will be able to declare abstract methods (methods that without body).
There will be a check in compile-time such that no public constructor is allowed without all abstract methods implemented.
*/