Skip to content

Instantly share code, notes, and snippets.

View Heppokoyuki's full-sized avatar

Heppoko Heppokoyuki

View GitHub Profile
@Heppokoyuki
Heppokoyuki / nobug.zig
Created December 19, 2020 08:27
nittc-procon advent calendar 2020
const std = @import("std");
fn read_num(comptime T: type, stdin: *const std.fs.File) T {
var buf: [64]u8 = undefined;
const len = stdin.read(&buf) catch |err| {
std.debug.warn("Error while reading number: {}\n", .{err});
std.os.exit(1);
};
if (len == buf.len) {
std.debug.warn("Input is too big!\n", .{});
@Heppokoyuki
Heppokoyuki / bug02.c
Created December 19, 2020 08:26
nittc-procon advent calendar 2020
#include <stdio.h>
int
main(void)
{
short v;
int data = 80;
printf("please input number: ");
scanf("%d", &v);
@Heppokoyuki
Heppokoyuki / bug01.c
Last active December 19, 2020 08:26
nittc-procon advent calendar 2020
#include <stdio.h>
int
main(void)
{
short v;
int data = 80;
printf("please input number: ");
scanf("%d", v);
@Heppokoyuki
Heppokoyuki / sample.c
Created December 25, 2019 02:42
risc-v assembly sample
int
func(int a, int b)
{
return a + b;
}
int
main(void)
{
int c = func(2, 3);
@Heppokoyuki
Heppokoyuki / log.txt
Created December 8, 2019 12:56
VS code log
[main 2019-12-08T12:32:58.248Z] Starting VS Code
[main 2019-12-08T12:32:58.250Z] from: /usr/lib/code
[main 2019-12-08T12:32:58.250Z] args: {
_: [],
diff: false,
add: false,
goto: false,
'new-window': false,
'reuse-window': false,
wait: false,
@Heppokoyuki
Heppokoyuki / lm_lid.sh
Last active March 9, 2019 14:05
Gentoo Linux Configuration on Thinkpad yoga260
#! /bin/sh
# /etc/acpi/actions/lm_lid.sh
case $(cat /proc/acpi/button/lid/LID/state | cut -d' ' -f7) in
closed) /usr/sbin/s2ram ;;
esac