Skip to content

Instantly share code, notes, and snippets.

View SirJson's full-sized avatar
:electron:
Am Heimcomputer sitz' ich hier, und programmier' die Zukunft mir

Raffael Zica SirJson

:electron:
Am Heimcomputer sitz' ich hier, und programmier' die Zukunft mir
View GitHub Profile
@vi
vi / miostdin.rs
Created October 9, 2017 19:15
Simple copy stdin to stdout example using Rust mio
extern crate mio;
use mio::unix::EventedFd;
use std::fs::File;
use mio::{Token, PollOpt, Ready, Poll, Events};
//use mio_uds::UnixStream;
use std::os::unix::io::{FromRawFd};
use std::io::{Read, Write};
From 93a400edcabee9de0d6b464e081aa9c562085559 Mon Sep 17 00:00:00 2001
From: Myy Miouyouyou <myy@miouyouyou.fr>
Date: Fri, 1 Feb 2019 17:13:57 +0000
Subject: [PATCH] Use eglGetPlatformDisplay when possible
And then fallback on eglGetDisplay if the initialization fails...
That said, currently the code only handle eglGetPlatformDisplay
with GBMm in order to initialize displays with DRM/KMS backends.
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
@giuliomagnifico
giuliomagnifico / padd.sh
Last active January 7, 2023 16:22
Custom PADD layout for 800x480px displays
#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck disable=SC1091
# shellcheck disable=SC2154
# PADD
#
# A more advanced version of the chronometer provided with Pihole
# SETS LOCALE
@danmikita
danmikita / init.vim
Created November 16, 2018 19:16
File preview with FZF, RG, Bat, and Devicons
nnoremap <silent> <leader>e :call Fzf_dev()<CR>
" ripgrep
if executable('rg')
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"'
set grepprg=rg\ --vimgrep
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
endif
" Files + devicons
@phha
phha / gi
Created August 10, 2017 17:30
Interactively greate a gitignore file from gitignore.io
#!/bin/sh
# Create useful gitignore files
# Usage: gi [param]
# param is a comma separated list of ignore profiles.
# If param is ommited choose interactively.
function __gi() {
curl -L -s https://www.gitignore.io/api/"$@"
}
@chinmaygarde
chinmaygarde / FlutterEmbedderGLFW.cc
Last active November 23, 2023 16:26
Flutter Embedder API Example (GLFW with OpenGL)
#include <assert.h>
#include <chrono>
#include <embedder.h>
#include <glfw3.h>
#include <iostream>
static_assert(FLUTTER_ENGINE_VERSION == 1, "");
static const size_t kInitialWindowWidth = 800;
public interface IPromiseCallbackHandler
{
void SetResult(string json);
void SetError(string error);
}
@ariok
ariok / AAIControllerTeam.cpp
Last active February 22, 2024 18:12
UE4 Perception AI System: Detect By Affiliation
#include "AIControllerTeam.h"
// A Tutorial for this code is available here:
// https://www.thinkandbuild.it/ue4-ai-perception-system/
AAIControllerTeam::AAIControllerTeam()
{
SetGenericTeamId(FGenericTeamId(5));
}
@JChristensen
JChristensen / AVR Sleep
Last active March 31, 2024 18:42
AVR microcontroller sleep demonstrations
Simple demonstrations of putting AVR microcontrollers to sleep in power-down mode,
which results in minimum current. Coded with Arduino IDE version 1.0.4 (and with
the Arduino-Tiny core for the ATtiny MCUs, http://code.google.com/p/arduino-tiny/)
For ATmega328P, ~0.1µA.
For ATtinyX5 revisions that implement software BOD disable, ~0.1µA,
for ATtinyX5 revisions that don't, ~20µA.