Skip to content

Instantly share code, notes, and snippets.

View anta40's full-sized avatar

Andre anta40

  • Jakarta, Indonesia
  • 17:33 (UTC +07:00)
View GitHub Profile
@anta40
anta40 / rx64_readme.txt
Created September 9, 2023 06:58
How to build rx64
1. Build mkfs
cd bin
make mkfs
2. Go back to the root project dir, make sdahci0.img
dd if=/dev/zero of=sdahci0.img bs=1m count=1024
3. cargo xtask build and cargo xtask run
4. cd cmd && sh mk)` and then `cargo xtask run` again.
@anta40
anta40 / scaninbox1.go
Created September 6, 2023 07:05
Try to fetch attachment...
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"github.com/emersion/go-imap/"
"github.com/emersion/go-imap/v2/imapclient"
@anta40
anta40 / scaninbox.go
Created September 5, 2023 14:01
Scan inbox for emails from a certain sender
package main
import (
"fmt"
"github.com/emersion/go-imap/v2"
"github.com/emersion/go-imap/v2/imapclient"
)
func generateIdRange(startIdx, endIdx uint32) []uint32 {
@anta40
anta40 / init.vim
Created October 15, 2022 16:13
My init.vim last updated 15 Oct 2022
" vim-bootstrap 2021-11-25 06:30:01
"*****************************************************************************
"" Vim-Plug core
"*****************************************************************************
let vimplug_exists=expand('~/./autoload/plug.vim')
if has('win32')&&!has('win64')
let curl_exists=expand('C:\Windows\Sysnative\curl.exe')
else
let curl_exists=expand('curl')
@anta40
anta40 / Makefile
Created October 12, 2022 20:14
Modified x64 xv6 Makefile
-include local.mk
X64 ?= yes
ifeq ("$(X64)","yes")
BITS = 64
XOBJS = kobj/vm64.o
XFLAGS = -m64 -DX64 -mcmodel=kernel -mtls-direct-seg-refs -mno-red-zone
LDFLAGS = -m elf_x86_64 -z nodefaultlibs
QEMU ?= qemu-system-x86_64
@anta40
anta40 / init.vim
Created October 9, 2022 16:41
My init.vim
" vim-bootstrap 2021-11-25 06:30:01
"*****************************************************************************
"" Vim-Plug core
"*****************************************************************************
let vimplug_exists=expand('~/./autoload/plug.vim')
if has('win32')&&!has('win64')
let curl_exists=expand('C:\Windows\Sysnative\curl.exe')
else
let curl_exists=expand('curl')
#include <stdio.h>
// Ini compile OK
void cobacoba();
// Ini compile error
//void cobacoba(void);
int main(void){
char *foo = "hello world";
[{
"name": "Afghanistan",
"code": "AF"
},
{
"name": "Åland Islands",
"code": "AX"
},
{
"name": "Albania",
@anta40
anta40 / MainActivity.java
Created September 21, 2022 13:44
Country demo
package com.anta40.app.countrycruddemo;
import androidx.annotation.MainThread;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import android.view.LayoutInflater;
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:padding="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_marginTop="5dp"