Skip to content

Instantly share code, notes, and snippets.

View fabriciofx's full-sized avatar
🎯
Focusing

Fabricio Cabral fabriciofx

🎯
Focusing
  • Brazil
View GitHub Profile
@nickcarenza
nickcarenza / lazy_evaluation.go
Created February 20, 2015 18:35
Golang Lazy Evaluation
package main
import (
"time"
)
type LazyInt chan func() int
// Can't use pointer receiver: invalid operation: l <- (func literal) (send to non-chan type *LazyInt)
func (l LazyInt) Future(i int) {
/* VT100 terminal reset (<ESC>c) */
console.log('\033c');
/* numbers comparations */
> '2' == 2
true
> '2' === 2
@mlocati
mlocati / win10colors.cmd
Last active September 24, 2024 13:45
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m
@mlocati
mlocati / main.c
Last active January 19, 2024 14:10
Enable/disable/check color support for Windows (ENABLE_VIRTUAL_TERMINAL_PROCESSING flag)
#define _WIN32_WINNT 0x0600
#include <stdio.h>
#include <windows.h>
#include <fileapi.h>
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active November 4, 2024 07:33
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@esters
esters / Apple-Magic-Mouse-Windows-10-Drivers.txt
Last active July 17, 2023 07:56
Apple Magic Mouse (A1296) - Windows 10 x64 Drivers
1. Download Brigadier - https://github.com/timsutton/brigadier/releases
2. Extract and run Brigadier (via CMD) with the following flags - brigadier.exe -m Macmini8,1
3. Brigadier will download and extract the bootcamp drivers for Mac Mini (2018)
4. Navigate - BootCamp-091-87418\BootCamp\Drivers\Apple\AppleWirelessMouse
5. Right click on AppleWirelessMouse.inf - Install.
@mrbid
mrbid / sine_bench.c
Last active March 1, 2024 17:27
A benchmark of different trigonometric sine functions.
/*
James William Fletcher (github.com/mrbid)
August 2021 - March 2024
Benchmarking sine wave functions.
https://james-william-fletcher.medium.com/benchmarking-sine-functions-16b067bf63ce
references:
http://www.ee.ic.ac.uk/pcheung/teaching/ee3_Study_Project/Sinewave%20Generation(708).pdf
https://demonstrations.wolfram.com/SineWaveGenerationUsingAnUnstableIIRFilter/