Skip to content

Instantly share code, notes, and snippets.

@cuu
cuu / fontdemo.py
Last active Jul 7, 2020
create a image contains 256 ascii in specific font, font demo game resource image ,raster
View fontdemo.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Needs freetype-py>=1.0
# For more info see:
# http://dbader.org/blog/monochrome-font-rendering-with-freetype-and-python
# The MIT License (MIT)
#
# Copyright (c) 2013 Daniel Bader (http://dbader.org)
@cuu
cuu / mesa.log
Created Dec 20, 2019
mesa install for gameshell log
View mesa.log
git clone https://gitlab.freedesktop.org/mesa/mesa.git --depth 1
meson setup mesa _build \
-D buildtype=release \
-D prefix=/usr \
-D sysconfdir=/etc \
-D platforms=x11,wayland,drm,surfaceless \
-D dri-drivers=[] \
-D gallium-drivers=lima,kmsro,swrast \
-D vulkan-drivers=[] \
@cuu
cuu / raw.github.lsp
Created Nov 27, 2019
generate raw.github for github repo file
View raw.github.lsp
#!/usr/bin/env newlisp
; simple encoder
(define (url-encode str)
(replace {([^a-zA-Z0-9])} str (format "%%%2X" (char $1)) 0))
(define (encode_space str)
(replace " " str "%20" )
)
@cuu
cuu / cut_video_fragments.sh
Created Sep 4, 2019
微信小视频切割脚本
View cut_video_fragments.sh
#!/bin/bash
FILENAME=${1}
MIN_FRAGMENT_LENGTH=300
if [ ! -f "${FILENAME}" ]; then
echo "FILE NOT FOUND: $FILENAME"
exit 1
fi
@cuu
cuu / retroarch-core-options.cfg
Created Aug 6, 2019
gameshell v0.4 mame 2003 plus fix for gamepad
View retroarch-core-options.cfg
mame2003-plus_analog = "digital"
mame2003-plus_art_resolution = "1"
mame2003-plus_brightness = "1.0"
mame2003-plus_cheat_input_ports = "disabled"
mame2003-plus_core_save_subfolder = "enabled"
mame2003-plus_core_sys_subfolder = "enabled"
mame2003-plus_dcs_speedhack = "disabled"
mame2003-plus_deadzone = "20"
mame2003-plus_display_artwork = "enabled"
mame2003-plus_display_setup = "disabled"
View simple_irc.c
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h>
View sdl_2.go
package main
import (
"fmt"
"math/rand"
"github.com/veandco/go-sdl2/sdl"
"os"
)
var winTitle string = "Go-SDL2 Render"
View sdl_2.c
#include <stdio.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
int main() {
int windowHeight = 240;
int windowWidth = 320;
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
View sdl_1.c
#include <stdio.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
int main() {
int windowHeight = 240;
int windowWidth = 320;
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
@cuu
cuu / expand_rootfs
Last active Jul 20, 2019
expand_rootfs for gameshell
View expand_rootfs
#!/bin/sh
### BEGIN INIT INFO
# Provides: expand_rootfs
# Required-Start:
# Required-Stop:
# Default-Start: 3
# Default-Stop:
# Short-Description: Expand the root filesystem to fill partition
# Description:
### END INIT INFO
You can’t perform that action at this time.