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
// Halt on panic | |
#[allow(unused_extern_crates)] // NOTE(allow) bug rust-lang/rust#53964 | |
extern crate panic_halt; // panic handler | |
use cortex_m; | |
use cortex_m_rt::entry; | |
use stm32f4xx_hal as hal; | |
use crate::hal::{prelude::*, stm32}; |
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
// My CPU struct | |
#[derive(Debug)] | |
pub struct Cpu { | |
opcode: u16, | |
memory: Box<[u8; 4096]>, // 0x000 - 0xFFF. 0x000 - 0x1FF for interpreter | |
v: [u8; 16], // 8-bit general purpose register, (V0 - VE*). | |
i: u16, // Index register (start at 0x200) | |
pc: u16, // Program Counter. Jump to 0x200 on RST | |
stack: [u16; 16], // Interpreter returns to value when done with subroutine | |
sp: u16, // Stack pointer |
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
pub fn main() { | |
let path = Path::new("/home/stian/projects/rosten/tracking.json"); | |
let display = path.display(); | |
let mut file = match File::open(&path) { | |
Err(e) => panic!("unable to open {}: {}", display, e.description()), | |
Ok(file) => file, | |
}; | |
let mut buffer = String::new(); |
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
" General settings | |
set nohud | |
set nosmoothscroll | |
set noautofocus " The opposite of autofocus; this setting stops | |
" sites from focusing on an input box when they load | |
set typelinkhints | |
let searchlimit = 30 | |
let scrollstep = 70 | |
let barposition = "bottom" | |
let hintcharacters = "ashtneoi" |
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
var data = { | |
"customers": [{ | |
"firstName": "John", | |
"lastName": "Smith", | |
"age": 25, | |
"address": { | |
"streetAddress": "20 Broadway St", | |
"city": "New York", | |
"state": "NY", | |
"postalCode": "10021", |
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
" exrc for wasavi´ | |
set expandtab | |
set tabstop=2 shiftwidth=2 | |
set autoindent | |
set expandtab | |
map [noremap] n j | |
map [noremap] e k | |
map [noremap] s h | |
map [noremap] t l | |
map [noremap] f e |
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
" Settings | |
set nohud | |
set nosmoothscroll | |
set noautofocus " The opposite of autofocus; this setting stops | |
" sites from focusing on an input box when they load | |
set typelinkhints | |
let searchlimit = 30 | |
let scrollstep = 70 | |
let barposition = "bottom" | |
let locale = "no" " Current choices are 'jp' and 'uk'. This allows cVim to use sites like google.co.uk |
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
# Temperature converter | |
# Made by Stian | |
# | |
puts "Convert from Celsius to Fahrenheit or Fahreinheit to Celsius" | |
puts "Please select 1 for Celsius or 2 for Fahrenheit" | |
selection = gets.to_i | |
# Conversion formulas | |
# °F = (°C · 9/5) + 32 | |
# °C = (°F − 32) · 5/9 |