Skip to content

Instantly share code, notes, and snippets.

View alviroiskandar's full-sized avatar
🍇
Grape

Alviro Iskandar Setiawan alviroiskandar

🍇
Grape
View GitHub Profile
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <netinet/in.h>
<?php
const APP_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$db_file = __DIR__."/db.json";
/**
* @param int $val
* @return array
*/
function hextorgb(int $val): array
<?php
$x = '{
"87ea1da1f230b2bbdf6c1d55aebca015": {
"link_fb": "https://www.facebook.com/profile.php?id=100079382088696",
"created_at": "2022-06-08 03:51:09"
},
"25b77e954948eb7af45ea6be6e501ce4": {
"link_fb": "https://www.facebook.com/profile.php?id=100055461167518",
"created_at": "2022-06-08 03:51:17"
// SPDX-License-Identifier: Public domain
/*
* @author Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
*
* Link: https://t.me/CCpp_Indonesia/62635
*
* v2:
* - Fix a small bug when the last char group is a word.
* Link: https://t.me/CCpp_Indonesia/62700
/*
* excercise simple arithmetic with intel AVX-512
*/
.section .data
arr1:
.quad 0x1, 0x2, 0x3, 0x4
arr2:
.quad 0x1, 0x2, 0x3, 0x4
arr3:
.quad 0x0, 0x0, 0x0, 0x0
#include <inttypes.h>
#include <stdint.h>
#include <pthread.h>
#include <stdio.h>
#include <stdatomic.h>
typedef int spinlock_t;
void __spin_lock(spinlock_t *lock);
#include <stdio.h>
#include <string.h>
#define BUF_SIZE 4096
int main(int argc, const char *argv[])
{
char buf[BUF_SIZE];
unsigned line;
FILE *f;
@alviroiskandar
alviroiskandar / golang_stack.c
Last active October 9, 2022 16:47
A proof that Golang changes its %rsp to a newly mapped VM area.
// SPDX-License-Identifier: What-the-fuck-public-domain
/*
* No Copyright.
*
* Author: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
*
* Fuck Golang: A proof that Golang changes its %rsp to a newly
* mapped VM area.
*
* How to run this:
#include <liburing.h>
#include <stdio.h>
#define NR_ENTRIES 32
int main(void)
{
struct io_uring ring;
struct io_uring_sqe *sqe;
struct io_uring_cqe *cqe;
unsigned i, j, head;
#include <unistd.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <string.h>
#include <stdio.h>
static int system_fd(const char *cmd)
{
int pipe_fd[2];
pid_t child;