Skip to content

Instantly share code, notes, and snippets.

Avatar
🐟
Tuned pro gramming

Luís Ferreira ljmf00

🐟
Tuned pro gramming
View GitHub Profile
View setmem.d
module setmem;
export void* _d_memset(size_t tsz)(void* dst, void[tsz] val, size_t sz)
{
static if (tsz == 1) return setmem8 (dst, val, sz);
else static if (tsz == 2) return setmem16 (dst, val, sz);
else static if (tsz == 4) return setmem32 (dst, val, sz);
else static if (tsz == 8) return setmem64 (dst, val, sz);
else static if (tsz == 16) return setmem128(dst, val, sz);
else static if (tsz == 32) return setmem256(dst, val, sz);
View chicken.ino
#define REL_PIN 12
#define LED_PIN 13
#define HOUR_MILIS (1000UL * 60 * 60)
#define ON_TIME_MILIS (1000UL * 60 * 20)
void setup() {
pinMode(REL_PIN, OUTPUT);
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW);
}
View app.d
int unicodeå()
{ return 0; }
int foo(int[] a)
{
bar();
a ~= 1;
return a[0];
}
View dwarf_d_issues.md

DWARF Generation on D compilers

  • DMD lacks information about DW_AT_decl_file, DW_AT_decl_line and DW_AT_decl_column on some tags.
  • LDC lacks information about DW_AT_decl_column.
  • LDC generates artificial DWARF variables and don't properly mark then as DW_AT_artificial.

Types

@ljmf00
ljmf00 / Dockerfile
Last active Jun 24, 2022
Android Emulator on docker
View Dockerfile
# _____ .___ __
# / _ \ ____ __| _/____ ____ | | __ ___________
# / /_\ \ / \ / __ |/ _ \_/ ___\| |/ // __ \_ __ \
# / | \ | \/ /_/ ( <_> ) \___| <\ ___/| | \/
# \____|__ /___| /\____ |\____/ \___ >__|_ \\___ >__|
# \/ \/ \/ \/ \/ \/
#
# Unbloat version of budtmo/docker-android-x86-11.0
# Thanks to @benjamin.botto for 3D hardware acceleration inside docker
#
@ljmf00
ljmf00 / .bashrc
Last active Sep 26, 2020
.bashrc
View .bashrc
#!/usr/bin/env bash
# shellcheck shell=bash
# shellcheck disable=SC2034
# shellcheck disable=SC2015
#
# ~/.bashrc
#
# ===============================
@ljmf00
ljmf00 / app.d
Created Jul 22, 2020
ADB Log Filter
View app.d
#!/usr/bin/env rdmd
import std.process;
import std.stdio;
import std.concurrency;
import core.thread;
import std.format;
import std.ascii;
import core.sync.mutex;
import std.file : remove, write;
View docker.sh
docker run -dit --name OracleDB -p 0.0.0.0:32769:1521 store/oracle/database-enterprise:12.2.0.1-slim
View fichas_bd.sql
-- ficha 1
-- ex3
SELECT DISTINCT funcao FROM empregado
ORDER BY funcao ASC;
-- ex4
SELECT nomeemp, salario, NVL(TO_CHAR(comissao), 'Nao existe') AS "comissao" FROM empregado
ORDER BY salario DESC, nomeemp ASC;
@ljmf00
ljmf00 / fancy_yaml.sh
Created Sep 10, 2019
Fancy YAML parser
View fancy_yaml.sh
# YAML Parser
# This function parse a simple YAML file and pass it to individual variables
# Usage: parse_yaml <FILE> [PREFIX]
# Thanks to: https://stackoverflow.com/questions/5014632/how-can-i-parse-a-yaml-file-from-a-linux-shell-script
parse_yaml() {
local prefix=$2
local ys='[[:space:]]*' yw='[a-zA-Z0-9_]*'
local fs
fs=$(echo @|tr @ '\034')