This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new-window -n irssi irssi | |
split-window -h -p15 -t0 ‘/bin/cat ~/.irssi/nicklistfifo’ | |
send-keys -t1 "tmux send-keys -t0 \"irssi\" C-m; \ | |
tmux send-keys -t0 \"/set nicklist_height \$(stty size | cut -f1 -d' ' -)\" C-m; \ | |
tmux send-keys -t0 \"/set nicklist_width \$(stty size | cut -f2 -d' ' -)\" C-m; \ | |
tmux send-keys -t0 \"/nicklist fifo\" C-m; \ | |
cat ~/.irssi/nicklistfifo" C-m | |
select-pane -t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use vars qw($VERSION %IRSSI); | |
use Irssi; | |
# Script info | |
$VERSION = '0.1'; | |
%IRSSI = ( | |
authors => 'Bas Stottelaar', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- Generated with glade 3.22.1 --> | |
<interface> | |
<requires lib="gtk+" version="3.20"/> | |
<object class="GtkMenu" id="open_recent_menu"> | |
<property name="visible">True</property> | |
<property name="can_focus">False</property> | |
</object> | |
<object class="GtkMenu" id="options_menu"> | |
<property name="visible">True</property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to use G_DECLARE_DERIVATIVE_TYPE and/or G_DECLARE_FINAL_TYPE in this code to reduce the "boilerplate code"? | |
Right now, errors building the code: | |
pet-dog.c: In function ‘pet_dog_print’: | |
pet-dog.c:17:36: error: invalid type argument of ‘->’ (have ‘PetBaseClass’ {aka ‘struct _PetBaseClass’}) | |
PET_DOG_GET_CLASS(self)->parent->print(self); | |
^~ | |
pet-dog.c: In function ‘pet_dog_class_init’: | |
pet-dog.c:86:27: warning: assignment to ‘void (*)(PetBase *)’ {aka ‘void (*)(struct _PetBase *)’} from incompatible pointer type ‘void (*)(PetDog *)’ {aka ‘void (*)(struct _PetDog *)’} [-Wincompatible-pointer-types] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <glib.h> | |
#include <glib/gi18n.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
typedef int32_t i32; | |
// A sample object data | |
struct data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <glib.h> | |
#include <gmodule.h> | |
struct entity { | |
int32_t value; // 4 bytes | |
char name[12]; // 12 bytes | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL2/SDL.h> | |
int main(void) { | |
SDL_bool quit = SDL_FALSE; | |
SDL_Init(SDL_INIT_VIDEO); | |
SDL_Window *window = SDL_CreateWindow("Mouse events", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_SHOWN); | |
SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); | |
SDL_SetRenderDrawColor(renderer, 127, 127, 127, 255); | |
SDL_RenderClear(renderer); | |
SDL_Event event; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void dump_texture_to_file(SDL_Renderer *renderer, SDL_Texture *texture, const char *filename) | |
{ | |
SDL_Log("%s: ENTERING\n", __func__); | |
Uint32 format; | |
int access; | |
int width; | |
int height; | |
SDL_QueryTexture(texture, &format, &access, &width, &height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int dump_texture_to_file(SDL_Renderer *renderer, SDL_Texture *texture, const char *filename) | |
{ | |
SDL_Log("%s: ENTERING\n", __func__); | |
Uint32 format = 0; | |
int access = 0; | |
int width = 0; | |
int height = 0; | |
int retval = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL2/SDL.h> | |
void list_joysticks(); | |
int main(void) { | |
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); | |
int sdl_flags = SDL_INIT_JOYSTICK; | |
int is_running = 1; | |
SDL_Init(sdl_flags); |
OlderNewer