Skip to content

Instantly share code, notes, and snippets.

View ljmf00's full-sized avatar
🐟
Tuned pro gramming

Luís Ferreira ljmf00

🐟
Tuned pro gramming
View GitHub Profile
#!/usr/bin/env rdmd
module objcallgraph;
import std;
import core.memory;
extern(C) __gshared string[] rt_options = [ "scanDataSeg=precise", "gcopt=initReserve:1000 cleanup:finalize gc:precise" ];
alias Void = void[0];
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);
#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);
}
@ljmf00
ljmf00 / app.d
Last active October 28, 2021 00:26
int unicodeå()
{ return 0; }
int foo(int[] a)
{
bar();
a ~= 1;
return a[0];
}

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 June 24, 2022 03:17
Android Emulator on docker
# _____ .___ __
# / _ \ ____ __| _/____ ____ | | __ ___________
# / /_\ \ / \ / __ |/ _ \_/ ___\| |/ // __ \_ __ \
# / | \ | \/ /_/ ( <_> ) \___| <\ ___/| | \/
# \____|__ /___| /\____ |\____/ \___ >__|_ \\___ >__|
# \/ \/ \/ \/ \/ \/
#
# Unbloat version of budtmo/docker-android-x86-11.0
# Thanks to @benjamin.botto for 3D hardware acceleration inside docker
#
@ljmf00
ljmf00 / .bashrc
Last active September 26, 2020 23:20
.bashrc
#!/usr/bin/env bash
# shellcheck shell=bash
# shellcheck disable=SC2034
# shellcheck disable=SC2015
#
# ~/.bashrc
#
# ===============================
@ljmf00
ljmf00 / app.d
Created July 22, 2020 19:44
ADB Log Filter
#!/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;
docker run -dit --name OracleDB -p 0.0.0.0:32769:1521 store/oracle/database-enterprise:12.2.0.1-slim
-- 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;