Skip to content

Instantly share code, notes, and snippets.

@faan11
faan11 / floatToHalf.cpp
Last active October 15, 2020 09:44
Half float to float and viceversa... No infinity No NaN managed
uint16_t convertFloatToHalf(float in) {
if (in == 0){
return 0;
}
F32 f;
f.value = in;
F16 hf;
/**
* Use sign
@faan11
faan11 / layout-dialog.module.ts
Created September 6, 2020 08:45
Angular MatDialog feature module layout
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
BreakpointObserver,
Breakpoints,
BreakpointState
} from '@angular/cdk/layout';
import { Observable } from 'rxjs';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
@faan11
faan11 / commands.sh
Created March 2, 2020 17:51
Freenas permanent shutdown visudo configuration
#!/bin/bash
sudo mount -wu /
cat visudoadd.txt >> /conf/base/etc/local/sudoers
sudo mount -ru /
sudo reboot