Skip to content

Instantly share code, notes, and snippets.

View chauhankiran's full-sized avatar
🐢
Slow

KC chauhankiran

🐢
Slow
View GitHub Profile
// gcc player.c `pkg-config --cflags --libs gtk4` && ./a.out
#include <gtk/gtk.h>
static void _on_file_opened(GObject* source_object, GAsyncResult* res, gpointer data) {
GtkFileDialog* file_dialog = GTK_FILE_DIALOG(source_object);
GtkWindow* window = GTK_WINDOW(data);
GFile* file = NULL;
GError* error = NULL;
// gcc imager.c `pkg-config --cflags --libs gtk4` && ./a.out
#include <gtk/gtk.h>
static void _on_file_opened(GObject* source_object, GAsyncResult* res, gpointer data) {
GtkFileDialog* file_dialog = GTK_FILE_DIALOG(source_object);
GtkWindow* window = GTK_WINDOW(data);
GFile* file = NULL;
GError* error = NULL;
// gcc temrinal.c `pkg-config --cflags --libs gtk4 vte-2.91-gtk4` && ./a.out
#include <gtk/gtk.h>
#include <vte/vte.h>
static void on_child_exited(VteTerminal* terminal, int status, gpointer data) {
if (!GTK_IS_NOTEBOOK(data)) return;
GtkNotebook* notebook = GTK_NOTEBOOK(data);
GtkWidget* page = GTK_WIDGET(terminal);
@chauhankiran
chauhankiran / editor.c
Created April 3, 2026 07:48
Editor in Elementary / Enlightment Foundation Library / EFL
#include <Elementary.h>
#include <stdio.h>
#include <sys/stat.h>
typedef struct {
Evas_Object* entry;
Evas_Object* status;
char *filename;
} App_Data;
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body {
padding: 0;
margin: 0;
}
@chauhankiran
chauhankiran / node-folder-structure-options.md
Created July 19, 2024 15:07 — forked from lancejpollard/node-folder-structure-options.md
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
@chauhankiran
chauhankiran / main.c
Last active January 31, 2023 15:10
A life of the editor (see the revision/history to get more idea)
#include<stdlib.h>
#include<gtk/gtk.h>
GtkWidget *window;
GtkTextBuffer *text_buffer;
char *filename;
void quit_editor(GtkWidget *widget, gpointer data) {
gtk_main_quit();
}
@chauhankiran
chauhankiran / swap-ctrl-alt-gnome.md
Created August 8, 2022 09:30 — forked from dchenk/swap-ctrl-alt-gnome.md
Swap CTRL and ALT keys on GNOME

Swap CTRL and ALT keys on GNOME

From here: https://askubuntu.com/a/101877

Create a file called .Xmodmap in your home directory.

$ vim ~/.Xmodmap

Add the following lines to the file:

@chauhankiran
chauhankiran / Lox.js
Last active July 22, 2022 17:41
Raw (unoptimized and very bad) implementation of Lox language
// A Lox programming language.
const fs = require("fs");
const readline = require("readline");
// Global variables.
let source = "";
let start = 0;
let current = 0;
let line = 1;
let tokens = [];
@chauhankiran
chauhankiran / laravel-login.md
Created December 25, 2020 05:04
Laravel 8.x Login System

Laravel v8 Login System

Create a new Laravel project.

$ laravel new login-system
$ cd login-system
$ code .
$ php artisan serve