Skip to content

Instantly share code, notes, and snippets.

View llucere's full-sized avatar
📝
i may be slow to respond

llucere

📝
i may be slow to respond
View GitHub Profile
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created November 21, 2019 10:20
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@dirkk0
dirkk0 / main.cpp
Last active August 3, 2023 23:08
Basic SDL2 OpenGL application
// code nicked mainly from here:
// http://lazyfoo.net/tutorials/SDL/50_SDL_and_opengl_2/index.php
/* to compile
### installation on ubuntu
# install compiler etc
sudo apt-get install --yes software-properties-common g++ make
# install sdl2
@biomood
biomood / HelloWorld_ScreenMemory.asm
Created May 25, 2011 20:35
C64 Assembly Hello World (using screen memory)
;put Hello World using screen address
;rather than jsr $e716
processor 6502
org $1000
jsr $E544 ;clear the screen
;set the screen color memory
lda #0 ;black in A